Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register now.
I have a following leave dataset where employees submit leave requests in hours. Sometimes a leave request (e.g., for 4 hours) is later cancelled. In the data, this cancelled entry appears as a separate row with 0 hours and a status of "Completed", while the original request has between 1 to 8 hours.
I would like to create a DAX calculated column that identifies this kind of pair:
Two rows with the same LeaveDate (and ideally the same EmployeeID),
One of them has Hrs = 0 and Status = "Completed",
The other has Hrs between 1 and 8.
The goal is to flag the 0-hour "Completed" row as a cancellation of a previous leave request.
Any guidance or sample DAX would be greatly appreciated!
Solved! Go to Solution.
Hi @Sunila please try this calculated column
Hi @Sunila please try this calculated column
Hi Sunila,
It would be great if you can provide some sample data. Thanks in advance.
/* ===================================================================== */
If this reply helped solve your problem, please consider clicking "Accept as Solution" so others can benefit too. And if you found it useful, a quick "Kudos" is always appreciated — thanks!
Best Regards,
Maruthi
LinkedIn - http://www.linkedin.com/in/maruthi-siva-prasad/
X - Maruthi Siva Prasad - (@MaruthiSP) / X
/* ===================================================================== */
Hi @Sunila ,
To identify cancellations in your leave data, you can create a calculated column that checks for two key conditions:
The current row shows 0 hours and has a "Completed" status (indicating a cancellation).
There is another row for the same employee and same leave date with a leave request between 1 to 8 hours (indicating the original request).
If both conditions are met, the 0-hour row is flagged as a cancellation of the original leave.
This approach will help you clearly distinguish between genuine leave entries and those that represent canceled requests.
***********************************************************************************************************************
If this solution worked for you, kindly mark it as Accept as Solution and feel free to give a Kudos, it would be much appreciated!
Thank you,
Sarita
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
19 | |
13 | |
10 | |
9 | |
9 |