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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
FloK
Regular Visitor

Difference between two sliced visuals, displayed as a visual

Hi all,

 

I have tried finding the solution to my problem for a while now, but simply can't figure out a way. Finally decided that the only way forward is signing up here and ask for help.

 

The data looks roughly like this:

ProductMonthprofit
apple01-31-20231750
orange01-31-2023-4000
apple02-28-20231500
orange02-28-2023-3900
apple03-31-20231600
orange03-31-2023-2500
apple04-30-2023

1100

orange04-30-2023

500

 

I have created two visuals with a slicer each. The slicer is assigned to each visual using Format --> Edit interactions

FloK_1-1684764929745.png

Below this, there should be another visual that displays - in the same format - the difference between the two chosen months for each product.

E.g. for January 2023 vs. February 2023 that visual should display a bar of -250 for apple and +100 for orange.

 

Thanks a lot for your help!

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @FloK 

only if you have two date tables one for eeach slicer. 

View solution in original post

4 REPLIES 4
tamerj1
Super User
Super User

Hi @FloK 

only if you have two date tables one for eeach slicer. 

Hi @tamerj1 

Thanks for the hint. I have now created two tables (table slicer 1 / table slicer 2) and assigned them to the two visuals.

Unfortunately I'm still having trouble displaying the difference. I have set up the following measure:

Difference3 = 
VAR SelectedMonth1 = SELECTEDVALUE('Table slicer 1'[Date])
VAR SelectedMonth2 = SELECTEDVALUE('Table slicer 2'[Date])

return
    CALCULATE(SUM('Table slicer 1'[Value]),
    'Table slicer 1'[Date]=SelectedMonth1
    ) -

    CALCULATE(SUM('Table slicer 2'[Value]),
    'Table slicer 2'[Date]=SelectedMonth2
    )
 
And displayed it as a stacked column chart:
FloK_0-1684826082540.png

 

The third visual displays the same values as the first visual but not the difference.

 

Can you please help me adjust the the measure 'Difference3' (or the visual), so that it displays the actual difference?

 

Many thanks!!!

 
 

@FloK 

Not 100% like this but it should also work. Make sure interaction is active between all visuals 

It was indeed the interaction settings that prevented proper calculations 🙄

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors