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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Nazdac911
Helper II
Helper II

Depends of chosen slicers values , show the table of comparison

Hi all

I have the following flat table which consist of 4 simple columns:

continent, City, Product category, sales

Nazdac911_0-1670251106073.png

 

I want to use a slicer for City column and compare product categories sales for "only two cities"beside each other and calculate the delta
so the resulted table will be simillar like this, 

Nazdac911_1-1670251130740.png

 

Is this possible ?? 
Extra challenge: can I make the Matrix column headers equal to the chosen slicer values. 
Thanks in adavnce 
regards 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Nazdac911 , You can have meausre like

 

//Date1 is independent Date table
new measure =
var _max = maxx(allselected(city),city[city])
var _min = minx(allselected(city),city[city])
return

if(isinscope(city[city]) , [measure],
calculate([Measure], filter('city', 'city'[city] =_max )) -calculate([Measure], filter('city', 'city'[city] =_min )) )

 

isinscope will move delta to column grand total of matrix column

 

 

another approach

 

Compare Categorical Data Using Slicers - Compare two Brands: https://youtu.be/exN4nTewgbc

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Nazdac911 , You can have meausre like

 

//Date1 is independent Date table
new measure =
var _max = maxx(allselected(city),city[city])
var _min = minx(allselected(city),city[city])
return

if(isinscope(city[city]) , [measure],
calculate([Measure], filter('city', 'city'[city] =_max )) -calculate([Measure], filter('city', 'city'[city] =_min )) )

 

isinscope will move delta to column grand total of matrix column

 

 

another approach

 

Compare Categorical Data Using Slicers - Compare two Brands: https://youtu.be/exN4nTewgbc

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

As expected always  from you 

Thank you for the great solution 🙂 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.