0
votes

I want to create a measure SHARE that will return the division between value from the column SUM and SUM_SALES. But the catch is that the measure should use only the SUM value for which Primary column has the value == true.

All of these should be happening within the filter context, and the filter will be applied on the column KEY which comes from the other table.

Desired output:

KEY PRIMARY SALES SUM_SALES SHARE
1 true 10 20 0.5
1 false 2 20 0.5
1 false 3 20 0.5
2 false 15 100 0.8
2 false 5 100 0.8
2 ture 80 100 0.8

In other words, the measure SHARE should calculate the division between the value of SALES for which the PRIMARY column is true and SUM_SALES. The results should be the same for the all the rows in SHARE withing the filter context.

1

1 Answers

0
votes

How about this?

SHARE =
CALCULATE ( [SALES] / [SUM_SALES], Table1[PRIMARY] = "true" )