Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Hello! I would like some help with dax. I need to calculate the percentage that is absent. For this I have a table that stores people who have been absent from work:
Date | Person ID | Code for cause of absence | Code for organisation | Period |
2021-09-01 | 123 | A | 1200 | 202109 |
2021-09-01 | 345 | A | 1350 | 202109 |
2021-09-01 | 678 | B | 1250 | 202109 |
And so on | And so on | And so on | And so on | And so on |
I also have a table with all employees:
Period | PersonID | Code for organisation |
202109 | 123 | 1200 |
202109 | 345 | 1350 |
202109 | 678 | 1250 |
I made a measure that calculates how many are absent, and it looks like this: number absent =DISTINCTCOUNT('table_absence'[PersonID]).
I also have a measure that counts all employees.
Now I want a measure that calculate the percentage that is absent per day, but the problem is that first table is per day and the other one is per month.
I tried with this but it does not work:
Solved! Go to Solution.
Hi, @Anonymous
Please check the following methods.
number absent = DISTINCTCOUNT('table_absence'[Person ID])
absence per day (%) =
CALCULATE(DIVIDE([number absent],COUNT(employees[PersonID])),FILTER(ALL(employees),[Period]=SELECTEDVALUE(employees[Period])))
Regarding your other question, you need to provide a little more example data, which I fail to understand at the moment. You can be informed of the output you expect.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
Please check the following methods.
number absent = DISTINCTCOUNT('table_absence'[Person ID])
absence per day (%) =
CALCULATE(DIVIDE([number absent],COUNT(employees[PersonID])),FILTER(ALL(employees),[Period]=SELECTEDVALUE(employees[Period])))
Regarding your other question, you need to provide a little more example data, which I fail to understand at the moment. You can be informed of the output you expect.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
11 | |
9 | |
6 | |
5 | |
4 |