Forum Discussion
Comparing two states
- 1 year ago
HiFali324 ,
You can achieve your goal bt these steps:
1 - Create two tables for slicer 1 and slicer 2 by this DAX:Slicer 1 = VALUES(YourTable[Stage])Slicer 2 = VALUES(YourTable[Stage])2- Make sure tha they are NOT related:
3 - Add a new slicer and add a project column from YourTable
4- Now add two slicer, in the first one, add the stages from the Slicer 1 Table and in the second Slicer add the Stages from the Slicer 2 Table
Now add a measure to compare the cost value, in my case i'm just subtracting Slicer 1 - Slicer 2, feel free to adapt to attend your needs:
Diference = VAR totalSlicer1 = CALCULATE( SUM(YourTable[Cost]), FILTER( YourTable, YourTable[Stage] = SELECTEDVALUE('Slicer 1'[Stage]) ) ) VAR totalSlicer2 = CALCULATE( SUM(YourTable[Cost]), FILTER( YourTable, YourTable[Stage] = SELECTEDVALUE('Slicer 2'[Stage]) ) ) RETURN totalSlicer1 - totalSlicer2
Add this Matrix for card or table, and your result will look like this:
HiFali324 ,
You can achieve your goal bt these steps:
1 - Create two tables for slicer 1 and slicer 2 by this DAX:
Slicer 1 = VALUES(YourTable[Stage])Slicer 2 = VALUES(YourTable[Stage])
2- Make sure tha they are NOT related:
3 - Add a new slicer and add a project column from YourTable
4- Now add two slicer, in the first one, add the stages from the Slicer 1 Table and in the second Slicer add the Stages from the Slicer 2 Table
Now add a measure to compare the cost value, in my case i'm just subtracting Slicer 1 - Slicer 2, feel free to adapt to attend your needs:
Diference =
VAR totalSlicer1 =
CALCULATE(
SUM(YourTable[Cost]),
FILTER(
YourTable,
YourTable[Stage] = SELECTEDVALUE('Slicer 1'[Stage])
)
)
VAR totalSlicer2 =
CALCULATE(
SUM(YourTable[Cost]),
FILTER(
YourTable,
YourTable[Stage] = SELECTEDVALUE('Slicer 2'[Stage])
)
)
RETURN
totalSlicer1 - totalSlicer2
Add this Matrix for card or table, and your result will look like this: