Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Shine_456
Frequent Visitor

DAX query for completed and overdue status for measure and new column

Hi,

 

I have a query having training and task tables.

 

If user completes all trainings and start date is less than due date then status is completed.

If user completes one  training and one training is in progress and start date is less than due date then status is In progress.

If user Not started all trainings and start date is less than due date then status is Not started.

Need logic for count of completed,inprogress, notstarted and overdue.

Also need new column logic for completed, in progress, Not started and overdue.

   
Training InsightsTraining Status
Tr 1Users all completed TrainingCompleted
TR 2Users all completed TrainingCompleted
TR 3Few Users CompletedIn progress
TR 4Few Users Completed but training due date is passedOverdue
   
   
Team Performance Insights 
   
User 1 completed all assigned TrainingCompleted
User 2 completed all assigned TrainingCompleted
User 3Completed only few assigned trainingsIn progress
User 4Completed few trainings  but trainings with over dueOverdue

 

Tr table

org_idnametype_iddurationdue_daterow_status_idcreated_by_idcreated_atupdated_atid
200003Training 6100315-02-2022160002714-02-202214-02-2022100
200003Training 7100525-02-2022160002714-02-202214-02-2022103
200003Training 8100504-03-2022160002723-02-202223-02-2022106
200003Test Training Requirement-1100124-03-2022160002724-02-202224-02-2022109
200003Test Training Requirement-2103330-03-2022160002724-02-202224-02-2022112
200003Test Training Requirement-3106606-04-2022160002724-02-202224-02-2022115
200003TR-4103502-04-2022160003024-02-202224-02-2022118

 

Task table

org_idtraining_requirement_iduser_idstatusprogressrow_status_idid
200003103600027COMPLETED1001100
200003109600029NOT_STARTED01103
200003109600030COMPLETED1001106
200003115600027NOT_STARTED02109
200003115600028NOT_STARTED02112
200003115600030COMPLETED1001115
200003112600027IN_PROGRESS501118
200003115600027IN_PROGRESS501121
200003118600027COMPLETED1001124

Plz help me on this.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Shine_456,

I checked your sample data and find it does not include the detailed records mapping of user and training information.

The basic logic of the coding formula:

1, Add a calculated column to the user table to get the records from the table that stored user training information.

2. Get the distinct training id from the above steps and compare it with the training table id list and use these results to remark the user's status. (no records of the current user: not start, the id less than training table id: in progress, two id lists has same items: complete)

INTERSECT function (DAX) - DAX | Microsoft Docs

EXCEPT function (DAX) - DAX | Microsoft Docs

3. Add a calculated column to the training table based on user table records to remark status.

Regards,

Xiaoxin Sheng

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Shine_456,

I checked your sample data and find it does not include the detailed records mapping of user and training information.

The basic logic of the coding formula:

1, Add a calculated column to the user table to get the records from the table that stored user training information.

2. Get the distinct training id from the above steps and compare it with the training table id list and use these results to remark the user's status. (no records of the current user: not start, the id less than training table id: in progress, two id lists has same items: complete)

INTERSECT function (DAX) - DAX | Microsoft Docs

EXCEPT function (DAX) - DAX | Microsoft Docs

3. Add a calculated column to the training table based on user table records to remark status.

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.