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
acornell
Regular Visitor

Using slicer to dynamically choose metric - 300+ metrics

Hello all,

 

I've spent the last two days reading through this forum trying to find an answer, but all the similar questions have been for slicers with just a few options. 

 

An executive has requested that I create a line graph of actual metric values (like sales by month) next to a slicer containing all of our company metrics - there are over 300 metrics. The line graph would show just the one selected column from the slicer at a time. Every solution I've read has used SWITCH or hand coded a disconnected table.

 

I've tried 20+ variations of code, including below. I have one table (Dynamic Metric List) with one column that just lists the metrics (Metric List), and one table (Flat Data) with totally normalized metric values where each metric is its own column. :

 

Dynamic Display =
VAR MySelection = SELECTEDVALUE('Dynamic Metric List'[Metric List])
RETURN
SWITCH(TRUE(), MySelection = "Adjusted EBITDA", 'Flat Data'[Adjusted EBITDA], MySelection="Bad Debt", 'Flat Data'[Bad Debt], 'Flat Data'[Adjusted EBITDA])

 

The code above compiles, but isn't giving me the correct values or even letting me switch between the 2 example metrics (Adjusted EBITDA & Bad Debt). 

 

How can I create a giant slicer that dynamically changes the column in my line graph? 

 

We've only recently implemented Power BI, so it's important for this to work soon. 

 

Thanks in advance, I really appreciate it. 

1 REPLY 1
Anonymous
Not applicable

HI @acornell,

 

It is hard to create a measure with more than 300 columns with switch function to achieve dynamic choose.

 

On my opinion, I'd like to suggest you to unpivot columns to transform your data to attribute and value, then you can simply create visualization to achieve dynamic filter effect.

Unpivot Data Using Excel Power Query

 

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Kudoed Authors