1
votes

I'd like simply to add a calculated column to a pivot table that i got. This pivot table uses two sources of data. Each source provides one column to the pivot table. I wish I could divide one column per the other one.

I've tried to add a measure. In this measure, I'm not sure which table i should use it ("Table Name"). Besides that, I guess I'm defining the formula wrongly.

'definig the formula

=(DataSource1[Column1])/(DataSource2[Column2])

I simply would like to add to the pivot table the division (percentage) between the two columns mentioned.

Images:

Data Sample Data Model Pivot Table

2
please post your data sample, and images of the data model and the pivot table report.RADO
Hi RADO, thanks. Please see the information asked abovelucasnuensfe

2 Answers

0
votes

What you are missing is an aggregate function which tells DAX what to do with the Column.

In the example below, test_example 1 is not a valid formula since the engine does not know what you want to do with the column that you are referencing. In example 2, it knows that it needs to sum the column.

test_example := SourceA[ValueA]
test_example 2:= SUM( SourceA[ValueA] )
0
votes

Ignoring the typo in your measure, you need to SUM the values from each table:

= DIVIDE ( 
    SUM ( SourceA[ValuesA] ),
    SUM ( SourceB[ValuesB] ),
    BLANK()
)

Using the DIVIDE function avoids DIV/0 errors