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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Fali324
Helper II
Helper II

Comparing two states

Hi

My data is structured in the following way:

Project StageCost
A110
A220
B110
B240
B330
C110


For each project I want to compare the stages however I want to select the two stages I want to compare, so I would like slicer 1 to select a stage and slicer 2 to select a stage so I can do comparative measures. 

 

E.g. for Project B I may compare stage 1 to stage 2 or stage 2 to stage 3 or stage 1 to stage 3

 

How can I achive this?

 

Any help will be much apricated

 

Thanks,

1 ACCEPTED SOLUTION
Bibiano_Geraldo
Super User
Super User

Hi@Fali324 ,

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:

Bibiano_Geraldo_0-1737985606576.png

 

3 - Add a new slicer and add a project column from YourTable 

Bibiano_Geraldo_1-1737985702978.png

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

Bibiano_Geraldo_3-1737985857285.png

 

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:

Bibiano_Geraldo_4-1737986100096.png

 



View solution in original post

2 REPLIES 2
Bibiano_Geraldo
Super User
Super User

Hi@Fali324 ,

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:

Bibiano_Geraldo_0-1737985606576.png

 

3 - Add a new slicer and add a project column from YourTable 

Bibiano_Geraldo_1-1737985702978.png

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

Bibiano_Geraldo_3-1737985857285.png

 

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:

Bibiano_Geraldo_4-1737986100096.png

 



Fowmy
Super User
Super User

@Fali324 

Create additional dimension tables with no relationship for stage and use in a separate slicer, use a measure to capture the value selected from each visual and compare as you need.


Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors