Forum Discussion

pter14's avatar
pter14
Frequent Visitor
1 year ago
Solved

Creating a visual with measures

Hello guys,   In my table there is a category and quantity column, and I would like to show on a visual the share of each category from the total. I created measures for them which calculates the s...
  • FarhanJeelani's avatar
    1 year ago

    Hi pter14 ,

     

    1.Create a Single Measure for Category Share

    Instead of creating individual measures for each category, you can use a single dynamic measure:

    Category Share = DIVIDE( SUM('Table'[Quantity]), CALCULATE(SUM('Table'[Quantity]), ALL('Table'[Category])) ) 

    This formula calculates the share of each category’s quantity out of the total quantity dynamically.

     2.Use a Stacked Column Chart

    1. Add Category to the Axis of the visual.
    2. Add the Category Share measure to the Values.
    3. Format the visual to display percentage values.

    3. Add Tooltips (Optional)

    To enhance the visual:

    Include additional details in the tooltip, like the total quantity or the raw value for each category, using separate measures.

     

    Please mark this as solution if it helps yopu. Appreciate Kudos.