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
Anonymous
Not applicable

Is there a way to create a slicer that decides whoch fields are shown on a line chart?

 

Hi,

I'd like to solve the following problem: 

I need to show a line chart that shows 3-7 number of lines and the number of lines shown should depend on which option you choose from the slicer on the top (Basket).  If you choose BASKET_3, then I should see the 3 lines as in the picture. But if I pick BASKET_1, I should see 4 different lines representing other 4 different fields in the data. Is there a way to get this work? I've been struggling with it for so long....

 

Thank you!!

BOTGAB_1-1609943716528.png

 

7 REPLIES 7
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please provide a sample .pbix file and I'll try to realize the idea.

 

Best regards,
Lionel Chen

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

ToddChitt
Super User
Super User

The trick is to have the new table include rows for Fund Performance (Line Type) because that is the Legend breakdown in the line chart. 




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





Anonymous
Not applicable

Yes you are right! But I have 2 fields to put into the chart: one is the fund performance and the other one is the basket performance. I need to put these 2 measures into the chart and also a legend (line type). And I cannot put a legend into the chart if I have 2 variables in the Values. So having the basket performance in the chart does not allow to use legend. What I did so far is creating 2 seperate chart and making them overlap each other but it is not perfect.

amitchandak
Super User
Super User

Anonymous
Not applicable

Thank you, I think the bookmarks will help!

ToddChitt
Super User
Super User

Try this:

Create a new table (Enter Data) with two columns: Basket and Line. Have one row for each Line, and assign each Line to a Basket. Now relate this table to your data table on Line Type. Next, add a slicer to the page on Basket.

 

By selecting a single Basket, you will effectively filter the data table for only those Lines that are in that Basket.

 

Hope that helps.




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





Anonymous
Not applicable

Thank you, but then I would have all the possible lines in the labels, even though they would not appear in the chart, am I right?

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.