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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Quiny_Harl
Advocate III
Advocate III

Dynamic line chart with multi-select slicer

Hello,

I'm currently migrating a report from Qlik to Power BI. In the current report, we have a line chart where users have the option to choose which measures they want to visualize:

Quiny_Harl_0-1636037922649.png

They can choose any combinations between the 3 boxes on top. Every box is associated with 2 measures which are visualized on the line chart only when the user select that box.

Is there a way for this to be implemented in Power BI?

1 ACCEPTED SOLUTION
Quiny_Harl
Advocate III
Advocate III

3 REPLIES 3
Quiny_Harl
Advocate III
Advocate III

I found the solution in this video

https://www.youtube.com/watch?v=lvjtHRzWKxk

 

Anonymous
Not applicable

@Quiny_Harl , this is useful, but I have a couple of questions:

 

The chart legend still shows all four series regardless how many series are selected in the slicer. How can the legend be made to only show the selected measures?

 

This method does not work if your Power BI report uses an SSAS database. Is there a method to do this when using an SSAS database (other that creating a disconnected table in the data model)?

amitchandak
Super User
Super User

@Quiny_Harl , Asume you have three measure for these three lines M1, M2, M3 and you have table where you have these as rows values and you use that as slicer  (Table, slicer)

 

M1  New= 

var _cnt = countx(allselected(Slicer), Slicer[Value] ="M1")

return

if(isblank(_cnt), blank(), [M1])

 

M2  New= 

var _cnt = countx(allselected(Slicer), Slicer[Value] ="M2")

return

if(isblank(_cnt), blank(), [M2])

 

 

 

M3  New= 

var _cnt = countx(allselected(Slicer), Slicer[Value] ="M3")

return

if(isblank(_cnt), blank(), [M3])

 

Try these measures inplace of M1, M2 and M3 and the slicer

 

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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.