Forum Discussion
Interactive Pie Chart - Based on Metrics
- 3 months ago
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!
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.
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:
For the pie chart:
Then 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.