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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
budhie
Frequent Visitor

Any better way to compare values from 2 groups of slicers?

Hi, I want to compare values using a clustered column chart, in which these values are based on the parameters that I select on the slicers. These values are from the same dataset. You can see the example data (excel and pbix): Here 

 

The end goal is to have 2 groups of slicers ( left and right) and the values on the chart will change according to the selected parameters on the slicers of each group. You can find the end result that I want on the link above.

budhie_0-1703736103218.pngbudhie_1-1703736238066.png

I realized that using this way might not be the best way since the dashboard became heavy (long loading period) especially if I have a huge dataset (since I need to duplicate the dataset into two eventhough they are the same). Therefore, I would like to ask for suggestion/help on how to do it better, probably using DAX to get the result that I wanted?

 

Any help will be much appreciated, thank you!

 

@speedramps 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @budhie ,

 

Instead of replicating the sales and the database just recreate the tables that you need to use for your slicers in this case create disconnected tables for the Dates (includes Month and Year), Countries (includes City, Province , City),

Customer Gender, Product Type  then do the following two measures:

Value 1 = CALCULATE(
            SUM(Sales[Total Price]), 
            Sales[Product Type] in VALUES('Product Type 1'[Product Type]),
            Sales[Date] in VALUES('Dates 1'[Date]), 
            Database[City] in VALUES('Country 1'[City]), 
            Database[Province] in VALUES('Country 1'[Province]),
            Database[Country] in VALUES('Country 1'[Country]),
            Database[Customer Gender] in VALUES('Customer Gender 1'[Customer Gender])
            )


Value 2 = CALCULATE(
            SUM(Sales[Total Price]), 
            Sales[Product Type] in VALUES('Product Type 2'[Product Type]),
            Sales[Date] in VALUES('Dates 2'[Date]), 
            Database[City] in VALUES('Country 2'[City]), 
            Database[Province] in VALUES('Country 2'[Province]),
            Database[Country] in VALUES('Country 2'[Country]),
            Database[Customer Gender] in VALUES('Customer Gender 2'[Customer Gender])
            )

Create the slicer pane accordingly to the table numbers and measures

 

Check PBIX file attach.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

4 REPLIES 4
MFelix
Super User
Super User

Hi @budhie ,

 

Instead of replicating the sales and the database just recreate the tables that you need to use for your slicers in this case create disconnected tables for the Dates (includes Month and Year), Countries (includes City, Province , City),

Customer Gender, Product Type  then do the following two measures:

Value 1 = CALCULATE(
            SUM(Sales[Total Price]), 
            Sales[Product Type] in VALUES('Product Type 1'[Product Type]),
            Sales[Date] in VALUES('Dates 1'[Date]), 
            Database[City] in VALUES('Country 1'[City]), 
            Database[Province] in VALUES('Country 1'[Province]),
            Database[Country] in VALUES('Country 1'[Country]),
            Database[Customer Gender] in VALUES('Customer Gender 1'[Customer Gender])
            )


Value 2 = CALCULATE(
            SUM(Sales[Total Price]), 
            Sales[Product Type] in VALUES('Product Type 2'[Product Type]),
            Sales[Date] in VALUES('Dates 2'[Date]), 
            Database[City] in VALUES('Country 2'[City]), 
            Database[Province] in VALUES('Country 2'[Province]),
            Database[Country] in VALUES('Country 2'[Country]),
            Database[Customer Gender] in VALUES('Customer Gender 2'[Customer Gender])
            )

Create the slicer pane accordingly to the table numbers and measures

 

Check PBIX file attach.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



budhie
Frequent Visitor

Hi @MFelix , Thank you so much!! This is what I need!

MFelix
Super User
Super User

Hi @budhie ,

 

Have you tried using field parameters for this?


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



budhie
Frequent Visitor

Hi Felix @MFelix , thanks for your response. I have never utilize Field Parameter before. After do some checking, I think the way how Field Parameter works more on to change the x-axis of the chart based on the selected parameter? Where on my case, the x-axis will remain the same and the only changes are on the y-axis based on the parameters that I select on the slicers

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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