Forum Discussion
Interactive Pie Chart - Based on Metrics
Hello All,
I don't know whether it is technically possible or not, but curious to know.
I want to create a piechart where "Campaign Types" will be the legends and it will be change based on selection of a dedicated filter. The filters will be "Impressions", "Clicks" and "Cost/Click".
Please let me know if any further inputs required or not.
Regards
Utsav
Hi utsavlexmark,
Yes, Absolutely. You can acheieve this by creating measures and then using them as field parameters by going to
Modeling β New parameter β Fields.Then Create a pie chart use Campaign type as legends and Field (Parameter) from "Field parameter" table which you just created.Attached is the sample .pbix file for your reference.π I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
π‘ Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
π As a proud SuperUser and Microsoft Partner, weβre here to empower your data journey and the Power BI Community at large.
π Curious to explore more? [Discover here].
Letβs keep building smarter solutions together!
2 Replies
- ParchitectSolution Sage
Hi utsavlexmark!
Yes, this is possible in Power BI.
The recommended approach is to use a Field Parameter to let the user switch the metric used in the pie chart. Field Parameters are designed for this type of scenario, where report users dynamically change the measure used in a visual through a slicer.
Create measures like:Total Impressions = SUM ( 'Table'[Impressions] ) Total Clicks = SUM ( 'Table'[Clicks] ) Cost per Click = DIVIDE ( SUM ( 'Table'[Cost] ), SUM ( 'Table'[Clicks] ) )Then create a field parameter from:
Modeling β New parameter β FieldsFor the pie chart:
Legend = Campaign TypeValues = Metric Field ParameterThen use the generated field parameter slicer as your metric selector. When the user selects Impressions, Clicks, or Cost/Click, the same pie chart will update based on the selected measure.
There are some similar solved/community examples around dynamic visuals and slicer-based switching here:
Dynamic Pie Chart Based on Slicer Selection:
https://community.fabric.microsoft.com/t5/Desktop/Dynamic-Pie-Chart-Based-on-Slicer-Selection-containing-data/td-p/3388779Field Parameter with switch:
https://community.fabric.microsoft.com/t5/Desktop/Field-parameter-with-switch/td-p/4369216Microsoft documentation for Field Parameters:
https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters
Best regards,
Solutions Architect Β· Microsoft Fabric Specialist Β· @Parchitectπ‘Did my response help you? Clicking Kudos is a small gesture that goes a long way, it encourages contributors and helps the community thrive!
βοΈDid I answer your question? Please mark my post as a Solution, it helps others find the answer faster. - grazitti_sapnaSuper User
Hi utsavlexmark,
Yes, Absolutely. You can acheieve this by creating measures and then using them as field parameters by going to
Modeling β New parameter β Fields.Then Create a pie chart use Campaign type as legends and Field (Parameter) from "Field parameter" table which you just created.Attached is the sample .pbix file for your reference.π I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
π‘ Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
π As a proud SuperUser and Microsoft Partner, weβre here to empower your data journey and the Power BI Community at large.
π Curious to explore more? [Discover here].
Letβs keep building smarter solutions together!