Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I’m facing a challenge in Power BI where I need to calculate the delta (difference) between two dynamically selected measures and display this delta. I’m using two slicers to select these measures:
The problem arises when both slicers are set to filter the same table visual. This results in conflicting filters—where the table tries to match rows for both selected measures simultaneously—leading to blank values.
I have tried to resolve this by:
However, while this setup allows both measures to be calculated, the table visual isn't correctly filtered for both measures, causing incorrect delta calculations.
Any insights on this issue would be greatly appreciated!
Here are my calculations:
SelectedMeasure1 =
SWITCH(
SELECTEDVALUE(Measure1Table[MeasureName]),
"IBA", CALCULATE(SUM('Onshore + Offshore'[Value]), 'Onshore + Offshore'[Measure] = "IBA"),
"PBA", CALCULATE(SUM('Onshore + Offshore'[Value]), 'Onshore + Offshore'[Measure] = "PBA"),
"EAC", CALCULATE(SUM('Onshore + Offshore'[Value]), 'Onshore + Offshore'[Measure] = "EAC"),
"Actuals", CALCULATE(SUM('Onshore + Offshore'[Value]), 'Onshore + Offshore'[Measure] = "Actuals"),
"Commitment", CALCULATE(SUM('Onshore + Offshore'[Value]), 'Onshore + Offshore'[Measure] = "Commitment"),
"Released Budget", CALCULATE(SUM('Onshore + Offshore'[Value]), 'Onshore + Offshore'[Measure] = "Released Budget"),
BLANK()
)<li-code lang="markup">SelectedMeasure2 =
SWITCH(
SELECTEDVALUE(Measure2Table[MeasureName]),
"IBA", CALCULATE(SUM('Onshore + Offshore'[Value]), 'Onshore + Offshore'[Measure] = "IBA"),
"PBA", CALCULATE(SUM('Onshore + Offshore'[Value]), 'Onshore + Offshore'[Measure] = "PBA"),
"EAC", CALCULATE(SUM('Onshore + Offshore'[Value]), 'Onshore + Offshore'[Measure] = "EAC"),
"Actuals", CALCULATE(SUM('Onshore + Offshore'[Value]), 'Onshore + Offshore'[Measure] = "Actuals"),
"Commitment", CALCULATE(SUM('Onshore + Offshore'[Value]), 'Onshore + Offshore'[Measure] = "Commitment"),
"Released Budget", CALCULATE(SUM('Onshore + Offshore'[Value]), 'Onshore + Offshore'[Measure] = "Released Budget"),
BLANK()
)<p> </p><p> </p>
Solved! Go to Solution.
Have you tried field parameters? They offer a robust way of dynamically selecting measures.
https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters
The two measure tables in your model would be field parameters; these tables don't have relationships. See if you can adapt the solution below to dynamically calculate the delta between the selected measures.
Proud to be a Super User!
Have you tried field parameters? They offer a robust way of dynamically selecting measures.
https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters
The two measure tables in your model would be field parameters; these tables don't have relationships. See if you can adapt the solution below to dynamically calculate the delta between the selected measures.
Proud to be a Super User!
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
104 | |
99 | |
98 | |
38 | |
37 |
User | Count |
---|---|
158 | |
124 | |
75 | |
74 | |
63 |