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 relatively new to Power BI DAX formula.
I am working on a survey file which contains the below format.
Response ID | Q1 | Q2 | Q3 | Category |
1 | Favorable | Unfavorable | Neutral | Female |
2 | Favorable | Favorable | Neutral | Male |
3 | Favorable | Favorable | Unfavorable | Male |
4 | Unfavorable | Favorable | Favorable | Female |
I need to calculate the % Favorable for each category for each question, such as for Q1, for female %favorable=50%, Male=100%. I have several categories to add such as level, department etc. however I am struggling to calculate the % of total but show only value for favorable, as if I filter it doesn't take all the values in the denominator. I need this for a matrix format.
Level | Female% | Male% |
Consultant | 50% | 100% |
Senior | ... | ... |
Kindly advise on how to proceed.
Solved! Go to Solution.
@curiouspowerbi , Try measure like example
divide(Countrows(filter(Table, Table[Q1] ="Favorable")),Countrows(all(Table[Q])))
Thanks @amitchandak . I tried this, however the denominator doesn't seem to work. It is not counting the rows in the Q1 of the table. It is showing the value 4 when I have around 10000 rows.
Also, in my matrix, I have gender and level as two dimensions, please advise how I can get this to work that the % is calculated for the dimensions in the matrix.
Thanks for the guidance. I actually ended up using counta for the denominator and it worked fine.
@curiouspowerbi , Try measure like example
divide(Countrows(filter(Table, Table[Q1] ="Favorable")),Countrows(all(Table[Q])))
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 |
---|---|
114 | |
97 | |
86 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |