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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
paliman
Frequent Visitor

Difference between categories based on user´s selecction

Hello everyone.

 

This is my first post here. I´ve been searching for a while without finding what I need.

 

I have a sales table for different products and I want to build a dynamic measure to calculate the difference between any two categories based on user's selection. I've made a little simplification of my model in excel for better understanding, please see the screenshot below:

 

Dax Question.PNG

 

So I want the user to pick any two categories and come with the difference in total sales based on that selection. Ideally with two slicers called "Category 1" and "Category 2", but if it's easier with only one slicer, that'll do fine too

 

I hope it is clear enough, and any suggestion will be greatly appreciated.

 

Many thanks in advance

 

Pablo.

1 ACCEPTED SOLUTION
paliman
Frequent Visitor

Hi

 

Just to tell you that I found the solution here

 

https://stackoverflow.com/questions/51388963/how-to-get-the-difference-between-the-values-selected-b...

 

Thanks to all who took the time to read my post and think about it

 

Pablo

View solution in original post

1 REPLY 1
paliman
Frequent Visitor

Hi

 

Just to tell you that I found the solution here

 

https://stackoverflow.com/questions/51388963/how-to-get-the-difference-between-the-values-selected-b...

 

Thanks to all who took the time to read my post and think about it

 

Pablo

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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