Forum Discussion
Absence streak
- 2 years ago
Hi RudyL
Please refer tao attached sample file with the proposed solution - 2 years ago
Hi RudyL
You are right the ABSSTREAK calculated column. However I could not generate the other problem. Looks like the engine treats the blank as a zero anyway. I have a added a COALESCE statement as an additional layer to confirm the result.
Hi, RudyL
Thanks for tamerj1 reply. Can I ask if you have currently resolved the third issue? I used tamerj1's pbix file and then added DEPT_B with an ABSDATE of 1/1/2023, and the line corresponding to ABSSTARTFLAG seems to be the expected behavior. I don't understand what's wrong and if you can describe the effect you're looking for.
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi Anonymous ,
Thanks for your curiosity. But try the table below in which I inserted a second employee (513020) from a different department in the same data that tamerj1 used (just the 513019). When you take this dataset you will see that the calculations will be completely different, and wrong.
| DEPT | EMPID | ABSDATE | ABSFLAG |
| DEPT_B | 513019 | 02/01/2023 | 1 |
| DEPT_B | 513019 | 04/01/2023 | 1 |
| DEPT_B | 513019 | 05/01/2023 | 0 |
| DEPT_B | 513019 | 09/01/2023 | 1 |
| DEPT_B | 513019 | 11/01/2023 | 0 |
| DEPT_B | 513019 | 12/01/2023 | 0 |
| DEPT_B | 513019 | 16/01/2023 | 0 |
| DEPT_A | 513020 | 18/01/2023 | 1 |
| DEPT_B | 513019 | 18/01/2023 | 1 |
| DEPT_A | 513020 | 19/01/2023 | 0 |
| DEPT_B | 513019 | 19/01/2023 | 0 |
| DEPT_B | 513019 | 23/01/2023 | 0 |
| DEPT_A | 513020 | 23/01/2023 | 1 |
| DEPT_B | 513019 | 25/01/2023 | 1 |
| DEPT_B | 513019 | 26/01/2023 | 1 |
| DEPT_B | 513019 | 27/01/2023 | 1 |
| DEPT_A | 513020 | 27/01/2023 | 0 |
| DEPT_B | 513019 | 30/01/2023 | 1 |
| DEPT_B | 513019 | 31/01/2023 | 1 |
| DEPT_B | 513019 | 01/02/2023 | 1 |
| DEPT_B | 513019 | 02/02/2023 | 1 |
| DEPT_A | 513020 | 02/02/2023 | 1 |
| DEPT_A | 513020 | 03/02/2023 | 1 |
| DEPT_B | 513019 | 03/02/2023 | 1 |
| DEPT_B | 513019 | 06/02/2023 | 0 |
| DEPT_B | 513019 | 08/02/2023 | 0 |