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.
I'm looking for a way for Power BI to calculate percentages by comparing two #'s together. I'm also looking for a way these two #'s are the results of a distinct count. Example, column #1 has 6 occurrences of the word "Red"; column #2 has 2 occurrences of the word "Blue". I'd like the column #3 and #4 display the output ("6" and "2") and finally, column #5 and #6 display the percentage of occurrence that Red and Blue appear in the list. I need for the report to dynamically calculate as there will be a slicer in this report which will drive the content to filter on.
@Anonymous,
Please check if the following DAX return your expected result. If not, please help to share sample data of your table.
Column3 = CALCULATE(COUNTA(Table[Column1]),FILTER(Table,Table[Column1]="Red"))
Column4 = CALCULATE(COUNTA(Table[Column2]),FILTER(Table,Table[Column2]="Blue"))
% of Red = Table6[Column3]/COUNT(Table6[Column1])
% of Blue = Table6[Column4]/COUNT(Table6[Column2])
Regards,
Lydia Zhang
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 |
---|---|
101 | |
50 | |
19 | |
12 | |
11 |