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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
AFS
New Member

Create a graph comparing values of two sliced subgroups

Hello.

 

Sorry for the bad title. Let me explain the problem with an example.

 

I have two different pages with data on an Excel file. Let's call them P1 and P2:

 

 

Hoja1.pngHoja2.png

 

 

 

 

 

 

 

 

 

 

I want to create a graph that compares the values of a group from P1 and a group from P2 with the help of slicers. Here's what I got.

 

 

 

pantalla.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

At the top there's a slicer to select a Group (I, II or III) from both P1 and P2 each. In the image, group II is selected for P1 and group I is selected for P2.

 

In the middle there are two graphs from P1 and P2 respectively, showing the values of each name (A, B and C) from the group selected in each splicer. Both of these are correct, and I want to combine them in a single graph.

 

At the bottom you can see my attempt at the combined graph (selected). The values from P1 are showed correctly but the values from P2 are wrong, showing the total instead of each value.

 

This is probably a simple problem but I can't seem to figure it out. I'm trying to find a solution that doesn't require editing the Excel file, but if that's not possible then it doesn't matter.

 

Thanks in advance.

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

Create a Names table like:

 

Name

A

B

C

 

Make the obvious relationships to P1 and P2 tables. Use Names[Name] as your Axis.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

Create a Names table like:

 

Name

A

B

C

 

Make the obvious relationships to P1 and P2 tables. Use Names[Name] as your Axis.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Worked like a charm.

 

Cheers!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.