Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Currently I am displaying a ratio that shows the expense $ by department divided by the total revenue.
(MTD Exp to Revenue % =
Solved! Go to Solution.
A SWITCH should do the trick.
MTD Exp to Revenue % =
VAR Denom =
SWITCH (
SELECTEDVALUE ( Department[Department] ),
"Assembly", [Equipment Sales],
"Other Department", [Different Sales Figure],
[Total Sales]
)
RETURN
DIVIDE ( [MTD Expense], Denom )
You'll need to sum over the granularity you are showing in your visual (or a finer granularity).
SUMX ( VALUES ( Department[Department] ), [$ Variance to Budget B/(W)] )
How would I set up a second Variable? One other department would use a different sales figure, the remainder would be total sales.
A SWITCH should do the trick.
MTD Exp to Revenue % =
VAR Denom =
SWITCH (
SELECTEDVALUE ( Department[Department] ),
"Assembly", [Equipment Sales],
"Other Department", [Different Sales Figure],
[Total Sales]
)
RETURN
DIVIDE ( [MTD Expense], Denom )
This worked, thank you so much! My last question. Because of the weighting, how do I sum the measure? Example, $ Variance to Budget should be -21,033. It is doing the math of the percent minues the percent, times the grand total sales, just as the rows above, rather than summing the rows above. Thank you!
You'll need to sum over the granularity you are showing in your visual (or a finer granularity).
SUMX ( VALUES ( Department[Department] ), [$ Variance to Budget B/(W)] )
You can set up the logic like this:
MTD Exp to Revenue % =
VAR Denom =
IF (
SELECTEDVALUE ( Department[Department] ) = "Assembly",
[Equipment Sales],
[Total Sales]
)
RETURN
DIVIDE ( [MTD Expense], Denom )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |