Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
I have created a cluster bar chart which has the color counts on one axis, color categories on another axis, and the bars are symbolized according to name (picture below).
I would like to have data labels in each bar that show the % proportion of each bar's count against the grand total of counts across all categories.
For example, for Alice's Blue bar, I would like the bar to have a data label of 11% (since that bar shows a count of 1, and the grand total across all category counts is 9; 1/9); Marks' Blue bar should have a label of 44% (4/9), etc.
I would like to achieve this using a measure, and have been playing around with different measures, but I think what I'm having trouble with is understanding how a measure stores values.
For example, I can really easily visualize creating a summary table, which I've done using dax and power query, which would give me a simpe table of grouped values and their respective counts. But I'm having trouble visualizing how a measure can be used instead of a table to run calculations for categories and subcategories.
I think I have to do the following:
1. Get total count of all rows (to use as a denominator for calculating the proportions). ex: var totalcount = COUNTROWS(table)
2. Get counts across two categories -- names and colors
3. Divide counts of values against total row count. ex: var proportions = DIVIDE(counts, totalcount)
I think what I'm struggling with is number 2 -- getting counts across two categories and understanding how this is done.
User | Count |
---|---|
101 | |
68 | |
58 | |
47 | |
46 |