Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. 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.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
16 | |
13 | |
12 | |
11 | |
11 |
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
9 |