Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
doritilto
Regular Visitor

Dynamic Delta of 2 Values - Conflicting Slicer Interactions for Delta Calculations in Power BI

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:

  • Measure 1 Slicer: Filters the table to show values for the selected measure (e.g., "IBA").
  • Measure 2 Slicer: Used to select a different measure (e.g., "EAC") to calculate the delta against Measure 1.

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:

  • Allowing only the Measure 1 slicer to filter the table visual directly.
  • Setting the Measure 2 slicer to not filter the table directly, but to still influence the calculation of the second measure (SelectedMeasure2) using DAX functions like CALCULATE.

However, while this setup allows both measures to be calculated, the table visual isn't correctly filtered for both measures, causing incorrect delta calculations.

My Questions:

  • How can I calculate the delta correctly without causing conflicts between the slicers?
  • Is there a more effective way to manage slicer interactions or DAX context to solve this problem?

    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>

 

 

 

  • doritilto_0-1725867241625.png

     

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@doritilto,

 

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.

 

https://community.fabric.microsoft.com/t5/Desktop/Dynamic-Field-headings-for-matrix-reports/m-p/3098... 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
DataInsights
Super User
Super User

@doritilto,

 

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.

 

https://community.fabric.microsoft.com/t5/Desktop/Dynamic-Field-headings-for-matrix-reports/m-p/3098... 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.