Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello everyone
I have a data of employee number by sex like the following.
sex number
female 5
male 10
male 8
I need to calculate for example: Percent of male employee number showing separately in Card visual.
In case of this how should i write DAX expression for this.
Please help me
Thank you🤗🤔
Create DAX measure
Male = CALCULATE(SUM(MyTable[number])/SUMX(ALL(MyTable),MyTable[number]),MyTable[sex]="male")
Female = CALCULATE(SUM(MyTable[number])/SUMX(ALL(MyTable),MyTable[number]),MyTable[sex]="female")
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
@Ryansong - Should be,
Percent = SUMX(FILTER(ALL('Table'),[sex]="male"),[number]) / SUMX(ALL('Table'),[number])
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
10 | |
6 |