Forum Discussion
Dynamic Pie Chart "Values" based on Radio Button Selection
I have a table with "City", "5G", "eSim", etc and would like to create a pie chart that has "City" as the "Legend" and would like the "Values" field of the pie chart to be populated by a "Radio Button", "Slicer", etc that would contain the table headings "5G", "eSim", etc. so depending on the radio button selection, would depend on what data the pie chart would show. So in other words a dynamic chart. Is this possible?
Thanks in advance
Hi StuartSmith ,
So you wanna get a result such as below?
If so,go to query editor>select column "city">"unpivot columns">"unpivot other columns",and you will get a new table as below:
Then back to report view,create a measure as below:
Measure = CALCULATE(COUNT('Table'[City]),FILTER('Table','Table'[Value]="Yes"))See attached for the related .pbix file.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
4 Replies
- Pragati11
Super User
Hi StuartSmith ,
You will have to share some sample data for us to comment further if this is achievable based on your data structure or not.
Thanks,
Pragati
- StuartSmith
Power Participant
Pragati11 sample data would simply be...
City
5G Available eSIM VoLTE VoWiFi London Yes No Yes Yes New York Yes Yes Yes Yes Paris Yes No No No Madrid No Yes Yes No Then would like a pie chart with "City" for the pie chart "Legend" field, leaving the pie chart "Values" field empty and populated by whatever was selected from the selection of radio buttons or check boxes with "5G Available", "eSIM", "VoLTE" and "VoWiFi". So if the user select "5G" the chart would show 5G data for each city, and if "eSim" was selected it would show "eSim" data.
Hope that makes sense.
- v-kelly-msft
Community Support
Hi StuartSmith ,
So you wanna get a result such as below?
If so,go to query editor>select column "city">"unpivot columns">"unpivot other columns",and you will get a new table as below:
Then back to report view,create a measure as below:
Measure = CALCULATE(COUNT('Table'[City]),FILTER('Table','Table'[Value]="Yes"))See attached for the related .pbix file.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
- amitchandak
Super User
Dynamically change chart axis/legend in Power BI
https://www.youtube.com/watch?v=6jeSIRpjv0Mmeasure slicer -https://radacad.com/change-the-column-or-measure-value-in-a-power-bi-visual-by-selection-of-the-slicer-parameter-table-pattern
https://docs.microsoft.com/en-us/power-bi/power-bi-slicer-filter-responsive