Forum Discussion
samcaicn
9 years agoFrequent Visitor
want sorting by Percentage
Data column”SEX“ is ”0“ and ”1“; Axis is ”REGION“, Value is ”SEX“ percentage; can't sorting by male(0) percentage, ps help,thanks
- 9 years ago
You can use the CALCULATE function to count filtered values.
Male %age = CALCULATE(Count([sex]),[sex] = "Male") / Count([sex])
v-huizhn-msft
Microsoft Employee
9 years agoHi samcaicn,
The MALE is a calculated column? The synax of COUNTROWS function is COUNTROWS(<table>). Why you use column rather than table? Why you use Could you please share the complete DAX and your sample data for further analysis? So we can post the solution which is close your requirement. It's hard to reproduce your scenario. Thanks for understanding.
Best Regards,
Angelia
samcaicn
9 years agoFrequent Visitor
Thanks,your‘re right,so it show errors; ALL DAX is this two; the sample data is [SEX] 1 1 1 0 1 1..... Thanks for your help