Forum Discussion

utsavlexmark's avatar
utsavlexmark
Helper III
2 months ago
Solved

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

  • 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 β†’ Fields
     

    For the pie chart:

    Legend = Campaign Type
    Values = Metric Field Parameter
     

    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:

     

    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.

     

  • 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!