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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Dynamic Legend via Slicer with Option of All Average

Hi everyone, 

 

I am trying to find a solution to dynamically change the legends on a bar graph to either have values / averages broken down by each State in US or switch and see the average for the whole country against time. 

 

So far I found this solution: https://stackoverflow.com/questions/52428727/power-bi-dynamic-legend however it is only applicable for multiple countries and does not show country average in 1 line. 

 

Is there a work around? 

 

Thanks

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Create a new table and join with a table having state, bidirectional join many to many

 

new state =

Union(Summarize(Table, Table[State], "All State", Max(Table[State]) ), Summarize(Table, Table[State], "All State", "All"))

 

Try to use this table as a slicer and legend

 

Modified version of this video - Single Select with Select All : https://youtu.be/plGqCEZRfXU

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , Create a new table and join with a table having state, bidirectional join many to many

 

new state =

Union(Summarize(Table, Table[State], "All State", Max(Table[State]) ), Summarize(Table, Table[State], "All State", "All"))

 

Try to use this table as a slicer and legend

 

Modified version of this video - Single Select with Select All : https://youtu.be/plGqCEZRfXU

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.