Forum Discussion
FelipeGualberto
8 years agoFrequent Visitor
Filter and divide instead filtering twice with CALCULATE
Hello, I have the measure below and it works fine: Televisions Price per Unit = CALCULATE([Revenue]; DB[Product] = "Television") / CALCULATE([Amount]; DB[Product] = "Television") I wonder if ...
- 8 years ago
So something like:
Televisions Price per Unit = VAR __tmpTable = FILTER('DB',[Product]="Television") RETURN DIVIDE( SUMX(__tmpTable,[Revenue]), SUMX(__tmpTable,[Amount]), 0 )
Greg_Deckler
Community Champion
8 years agoSo something like:
Televisions Price per Unit =
VAR __tmpTable = FILTER('DB',[Product]="Television")
RETURN
DIVIDE(
SUMX(__tmpTable,[Revenue]),
SUMX(__tmpTable,[Amount]),
0
)FelipeGualberto
8 years agoFrequent Visitor
Thanks, I wonder if it is less efficient than using CALCULATE. I will test it later in DAX Studio.
Have a good day.