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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Dynamic chart based in a variable selector

Hi all!

 

I need to build a dynamic bar graph in which the legend is dynamic and is defined by the variable selected in a slicer, in this case, it could be selected to show the graph based on the following 3 values: Does anyone know if this can be done?

 

Thanks!

 

FinYui8_0-1657193766362.png

 

1 ACCEPTED SOLUTION

Hi, @Anonymous 

Yes, you can make it without parameters but you still need to manually create a table containing the values in the slicer, then create a new measure as below and apply it to the visual.

Measure = SWITCH(MAX(Slicer[Field Name]),"Country",[Measure 1],"Product",[Measure 2],"Technology",[Measure 3])

veasonfmsft_0-1657615870555.png

Please check my sample file for more details.

 

Best Regards,
Community Support Team _ Eason

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Try to use field parameters https://amitchandak.medium.com/power-bi-field-parameters-a-quick-way-for-dynamic-visuals-fc4095ae9afd

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

Thanks a lot, but is possible to make it without parameters?

 

Thanks

Hi, @Anonymous 

Yes, you can make it without parameters but you still need to manually create a table containing the values in the slicer, then create a new measure as below and apply it to the visual.

Measure = SWITCH(MAX(Slicer[Field Name]),"Country",[Measure 1],"Product",[Measure 2],"Technology",[Measure 3])

veasonfmsft_0-1657615870555.png

Please check my sample file for more details.

 

Best Regards,
Community Support Team _ Eason

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.