Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
I have several slicers in my report. I am trying to create a measure that will ignore one of the slicers
CUT = SUM('Data'[Cut Compacted])
I use Edit Interactions to get the CUT values to display properly. One CUT is shown using the Diff1 slicer, and the other CUT is shown using the Diff2 slicer.
The issue I am having is trying to create a measure that can calculate the difference between these 2 CUT values:
I tried this but it's not working:
I'm looking for a way to calculate these different CUT values.
Here is a link to my pbix:
https://sendit.hexagon.com/link/ZkiZ5TZrNpNkfgtpbTvaYn
Solved! Go to Solution.
Thanks for the reply from PijushRoy, please allow me to provide another insight.
Hi @cmazur71 ,
Please refer to the following steps.
1. Create a slicer table derived from the diff2 field.
Slcer_diff2 = VALUES(Data[Diff2])
2. Use this slicer table to create a slicer and synchronize it with the existing diff2 slicer.
4. Sets the interaction of the diff1 slicer and the Slicer_diff2 slicer for cards with the CUT_CHANGE measure applied.
5. Use the following DAX to create the CUT_CHANGE measure.
CUT_CHANGE =
VAR diff1 = SUM(Data[Cut Compacted])
VAR diff2 =
CALCULATE([CUT], Data[Diff2] IN VALUES(Slcer_diff2[Diff2]),REMOVEFILTERS(Data[Diff1]))
RETURN
diff2-diff1
6. The final result is as follows, hopefully it will meet your needs.
Please see the attached pbix for reference.
Best Regards,
Dengliang Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the reply from PijushRoy, please allow me to provide another insight.
Hi @cmazur71 ,
Please refer to the following steps.
1. Create a slicer table derived from the diff2 field.
Slcer_diff2 = VALUES(Data[Diff2])
2. Use this slicer table to create a slicer and synchronize it with the existing diff2 slicer.
4. Sets the interaction of the diff1 slicer and the Slicer_diff2 slicer for cards with the CUT_CHANGE measure applied.
5. Use the following DAX to create the CUT_CHANGE measure.
CUT_CHANGE =
VAR diff1 = SUM(Data[Cut Compacted])
VAR diff2 =
CALCULATE([CUT], Data[Diff2] IN VALUES(Slcer_diff2[Diff2]),REMOVEFILTERS(Data[Diff1]))
RETURN
diff2-diff1
6. The final result is as follows, hopefully it will meet your needs.
Please see the attached pbix for reference.
Best Regards,
Dengliang Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @cmazur71
To compute the difference between two measures while ignoring specific slicer selections in your Power BI report, you must use CALCULATE combined with ALLSELECTED or REMOVEFILTERS. Below are the steps and DAX code to achieve the desired functionality.
Here is the information, please look into and I hope you can solve the issue.
ALLSELECTED - https://learn.microsoft.com/en-us/dax/allselected-function-dax
REMOVEFILTERS - https://learn.microsoft.com/en-us/dax/removefilters-function-dax
4 DAX Measure code is mentioned below, please update the DAX code as per your requirement
Measure 1
CUT = SUM('Data'[Cut Compacted])
Measure 2
CUT WITH DIFF1 FILTER = CALCULATE(
[CUT],
REMOVEFILTERS('Data'[Diff2]) // Remove filters on Diff2
)
Measure 3
CUT WITH DIFF2 FILTER = CALCULATE(
[CUT],
REMOVEFILTERS('Data'[Diff1]) // remove filters on Diff1
)
Measure 4
CUT_CHANGE = [CUT WITH DIFF2 FILTER] - [CUT WITH DIFF1 FILTER]
Proud to be a Super User! | |
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
93 | |
87 | |
84 | |
67 | |
49 |
User | Count |
---|---|
141 | |
115 | |
111 | |
59 | |
59 |