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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
kash123
Frequent Visitor

Two lines on a chart, I want to have 4 slicers that link to one line and 4 that link to the other li

Hi 

 

Hope everyone is good!

 

My idea is that I want to have 1 graph with 2 (lines) curves that are independent.

 

In my data I have duplicated the data and created a new column (called legend) where i have labelled the first half "curve 1" and the other half "curve 2".

 

I have put this data on to a line chart and then in the legend I have put the new column, so I have two curves that are labelled curve 1 and curve 2

Now I want to link 4 slicers so that they only change curve 1 and then 4 other slicers only change curve 2. (they are exactly the same slicers)

please help 

 

thank you

If there is an easier way to do this please let me know?

 

Thank you!

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @kash123 

 

I think the simplest method is to split the data into two tables. One table for Curve 1 and the other for Curve 2. Then select fields from corresponding tables for related slicers. And select Sales columns from both tables into the line chart. In this way, a slicer having a field from Table Curve 1 won't affect the line from Table Curve 2.

 

One point is that you need to add a Dim Year table into the model which includes all unique Year values in a column. This column should be used as the X axis field on the chart. 

 

See attachment for details.

 

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.

View solution in original post

8 REPLIES 8
v-jingzhang
Community Support
Community Support

Hi @kash123 

 

I think the simplest method is to split the data into two tables. One table for Curve 1 and the other for Curve 2. Then select fields from corresponding tables for related slicers. And select Sales columns from both tables into the line chart. In this way, a slicer having a field from Table Curve 1 won't affect the line from Table Curve 2.

 

One point is that you need to add a Dim Year table into the model which includes all unique Year values in a column. This column should be used as the X axis field on the chart. 

 

See attachment for details.

 

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.

Perfect thank you

 

lbendlin
Super User
Super User

Please provide sample data in usable format (not as a picture) and show the expected outcome.

Hi so the sample data looks like this

kash123_0-1627161226644.png

The data basically tells the sales with different parameters, so different sources and an option to allow for inflation. It also has different countries etc. 

The primary aim is to have a chart with two lines that have 3 slicers each. So curve 1 could be UK, A(source of data), yes(adjust for inflation) and then curve 2 could be Germany, B, No. The lines would be indepedent of each other.  The slicers only link to the corresponding curve abd the user could compare whatever they like.

 

Here is a mock up of what I want: 

kash123_1-1627164149135.png

 

 

My current idea is to duplicate the data and add a new column called legend that essentially labels the first half Curve 1 and second half curve 2. And then add this column to the Legend of the line chart. But when I click on 1 slicer it impacts both curves

 

Data looks like this with the duplicated stuff:

kash123_2-1627164349442.png

Thank you !

Sorry i will add data in usable format in a second

 

lbendlin
Super User
Super User

Please familiarize yourself with "What-If?" parameters and how they work.

 

Note: You will want to use a Calendar table too.

Hi

Thank you for your reply, i have looked up what if parameters, and I am still not sure how to fix my problem. If you could share how, that would be extremely helpful?

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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