Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello
I'm new to Power BI and wanted to know if you can help me:
I have the following line chart
They are counting samples over several months and subdivided into 4 categories. I need you to show me not the count of each category in each month but the percentage that each category represents of each month's total.
Thank you
Solved! Go to Solution.
Thank you so much for the help!
By the time you answered, I had already found a solution:
I made the following measurements:
samples = count('table'[numberofsamples])
%samples = divide([samples], calculate([samples], allselected('table'[category])))
Then, in the line graph, on the Y-axis I put the measure %samples and in Legend I put 'table'[category]
Thank you so much for the help!
By the time you answered, I had already found a solution:
I made the following measurements:
samples = count('table'[numberofsamples])
%samples = divide([samples], calculate([samples], allselected('table'[category])))
Then, in the line graph, on the Y-axis I put the measure %samples and in Legend I put 'table'[category]
Hi,
it seems the measure you have created is returning count which you are using in values and categories in legend. You can create another measure share which would be count / total count.
I am not sure about the data, but if your count measure is like below:
cnt = distinctcount(samples)
then create another measure like
Total cnt = CALCULATE(distinctcount(samples), ALL(T1.category)) that will remove category filter.
Then Share cnt = cnt / Total cnt
Since data is not available, I am providing kind of pseudo code. Hope this helps.
If this help you to resolve your problem, then please mark it as solution, Thanks!
User | Count |
---|---|
102 | |
90 | |
80 | |
71 | |
69 |
User | Count |
---|---|
113 | |
99 | |
97 | |
72 | |
68 |