Forum Discussion
Creating a visual with measures
- 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
- Add Category to the Axis of the visual.
- Add the Category Share measure to the Values.
- 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.
pter14 , Try using
Create a measure for the total quantity:
TotalQuantity = SUM('YourTable'[Quantity])
Than Create a measure for the share of each category:
CategoryShare =
DIVIDE(
SUM('YourTable'[Quantity]),
[TotalQuantity],
0
)
Create a bar chart visualization:
Add the Category column to the Axis field.
Add the CategoryShare measure to the Values field.
- pter141 year agoFrequent Visitor
Hello bhanu_gautam,
Thank you for a quick suggestion, unfortunately this did not work. It is giving 100% for all of the categories.