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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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