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 it is possible, just for the sake of my perfeccionism, to filter first the DB table only the rows containing Television and then sum each columns' values and do the division operation. The fact that I must explicitly express the filter context DB[Product] = "Television" bothers me and there may be a better and elegant way.
Also: without breaking the storage engine security.
Thanks!
Solved! Go to Solution.
So something like:
Televisions Price per Unit = VAR __tmpTable = FILTER('DB',[Product]="Television") RETURN DIVIDE( SUMX(__tmpTable,[Revenue]), SUMX(__tmpTable,[Amount]), 0 )
So something like:
Televisions Price per Unit = VAR __tmpTable = FILTER('DB',[Product]="Television") RETURN DIVIDE( SUMX(__tmpTable,[Revenue]), SUMX(__tmpTable,[Amount]), 0 )
Thanks, I wonder if it is less efficient than using CALCULATE. I will test it later in DAX Studio.
Have a good day.
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!
User | Count |
---|---|
124 | |
76 | |
69 | |
54 | |
53 |
User | Count |
---|---|
191 | |
104 | |
83 | |
79 | |
78 |