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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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