Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi all,
I am using a matrix chart , where I want to show the % of each category like below :
for MUID 500167, there are 3-categories and frequency of each is mentioned. here Category 'General Medicine' have F=2, so % is 2/4*100 ie 50%, later for 'Infection Diease' F =1 , so % =1/4*100 ie 25% ,so on.
can someone help me?
Solved! Go to Solution.
Hi @Anonymous ,
Create a measure as below:
Measure =
var _counttotal=CALCULATE(SUM('Table'[M_Frequency]),FILTER(ALL('Table'),'Table'[MUID]=MAX('Table'[MUID])))
Return
IF(ISINSCOPE('Table'[Category]),DIVIDE(MAX('Table'[M_Frequency]),_counttotal),BLANK())
And you will see:
For the related .pbix file,pls see attached.
Hi @Anonymous ,
Create a measure as below:
Measure =
var _counttotal=CALCULATE(SUM('Table'[M_Frequency]),FILTER(ALL('Table'),'Table'[MUID]=MAX('Table'[MUID])))
Return
IF(ISINSCOPE('Table'[Category]),DIVIDE(MAX('Table'[M_Frequency]),_counttotal),BLANK())
And you will see:
For the related .pbix file,pls see attached.
@Anonymous , This seem like % of the subtotal
You need to use all except
Assume you are using Cat under MUID (rows of matrix)
Try a new measure like
% of subtotal = divide([M_frequency], calculate([M_frequency] , allexcept(Table, Table[Cat])))
refer :https://community.powerbi.com/t5/Desktop/Percentage-of-subtotal/td-p/95390
@Anonymous
can you share a sample dataset or even better a PBIX file?
by the looks of it, you need an inital measure which would be:
frequency of selected categories =
CALCULATE( [Sum of Frequencies], ALLSELECTED (Table[Category]))
followed by the final measure::
% of selected categories = DIVIDE( [Sum of Frequencies], [frequency of selected categories])
Proud to be a Super User!
Paul on Linkedin.
@PaulDBrown - Tested your solution Paul, worked like a charm.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
104 | |
87 | |
73 | |
66 |
User | Count |
---|---|
122 | |
112 | |
98 | |
79 | |
72 |