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
needtoknow
New Member

Calculating difference in data between two slicers and plotting stacked bar chart

I have a table that looks like this:

 

Location Day Product_Name Quantity 
East1Apples10
East1Oranges8
West1Apples15
West1Oranges5
North1Apples12
East2Apples8
East2Oranges12
West2Apples7
West2Oranges8
North1Apples10

 

I would like to get the difference in quantities for each Day and Product_Name between two Locations that are selected in slicers i.e:

 

Slicer 1 (Location): East

Slicer 2 (Location): West

 

The output desired would have the values of Slicer 1 minus Slicer 2 (East minus West) like the table below but in the form of a stacked bar chart with Day on the x-axis, Difference in the y-axis and Product_Name as the stacked categories.

 

Day Product_Name Difference 
1Apples-5
1Oranges3
2Apples1
2Oranges4

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@needtoknow , My video on similar topic can help

Power BI- Compare Categorical Data Using Slicers, Compare Two Brands/Categories/Cities: https://youtu.be/exN4nTewgbc

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@needtoknow , My video on similar topic can help

Power BI- Compare Categorical Data Using Slicers, Compare Two Brands/Categories/Cities: https://youtu.be/exN4nTewgbc

Perfect! Thank you @amitchandak

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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