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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Copycat
Frequent Visitor

Line chart visualization based on user choice

Good day beautiful people,

 

Below you can see my two objects: matrix table and graph. 

Data.png

 

What I struggle to achieve: 

If the user does not select any data from the matrix table, let the graph look like in the picture, showing total for each Customer Group for a period of time.

 However, if the user selects Customer Group 1 (or 2, 3, 4) I would like the graph to start showing Data Model data matching the given Customer Group.

 

Data2.png

So in this example, instead of seeing total for Customer 1, I would like to see 4 lines representing Data Model 1 - 4.

 

How can I achieve something like this?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Copycat ,

 

Here are the steps you can follow:

1. Create measure.

Group =
SUMX(FILTER(ALL('Table'),'Table'[Customer Group]=MAX('Table'[Customer Group])),[Score])
Group2 =
SUMX(FILTER(ALL('Table'),'Table'[Customer Group]=MAX('Table'[Customer Group])&&'Table'[Model]=MAX('Table'[Model])),[Score])
Flag =
IF(
    HASONEVALUE('Table'[Customer Group]),[Group2],[Group])

2. Fields are placed as follows.

vyangliumsft_0-1669881677220.png

3. Result:

When not selected

vyangliumsft_1-1669881677225.png

After selection.

vyangliumsft_2-1669881677229.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi  @Copycat ,

 

Here are the steps you can follow:

1. Create measure.

Group =
SUMX(FILTER(ALL('Table'),'Table'[Customer Group]=MAX('Table'[Customer Group])),[Score])
Group2 =
SUMX(FILTER(ALL('Table'),'Table'[Customer Group]=MAX('Table'[Customer Group])&&'Table'[Model]=MAX('Table'[Model])),[Score])
Flag =
IF(
    HASONEVALUE('Table'[Customer Group]),[Group2],[Group])

2. Fields are placed as follows.

vyangliumsft_0-1669881677220.png

3. Result:

When not selected

vyangliumsft_1-1669881677225.png

After selection.

vyangliumsft_2-1669881677229.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

amitchandak
Super User
Super User

@Copycat , You can either use customer or group as legend not both in line visual

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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