Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
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.
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
| User | Count |
|---|---|
| 51 | |
| 41 | |
| 32 | |
| 26 | |
| 24 |
| User | Count |
|---|---|
| 131 | |
| 118 | |
| 57 | |
| 45 | |
| 43 |