Forum Discussion
Power BI Direct Query DateDiff
- 3 years ago
Hi, ss8551
Not fully sure what you want.
Please check if formula below could help:
Result = VAR max_date = CALCULATE ( MAX ( 'Direct Query'[comp_train] ), ALL ( 'Direct Query' ) ) RETURN IF ( MAX ( 'Desktop PBI'[Date] ) > max_date, "Trained", "Not_Traind" )Best Regards,
Community Support Team _ Eason
This looks close, however, there are other courses with other completion dates. When this occurs, it pulls the latest completion date of all of the courses (not for the specific course in question). All courses are in one column, all rep ids are in one column, all completion dates are in one column.
It is therefore pulling the max date from the completion date column. Is there a way to pull the Max Date for a rep_id for a course so it doesn't pull the Max date from the column but only the max date for that specific course and date and rep? I modified the file that you had attached to show you what happens if a course completion date of 11/30/22 is entered. You’ll notice that the Result is showing not trained for all since it’s using the max date of 11/30 instead of the max date of when the specific course was completed. Sorry I couldn't find a way to re-upload the file that you had shared.
Hi, ss8551
Not sure what you mean by 'pull the Max Date for a rep_id for a course '.
Please check the modifed pbix if it helps.
Best Regards,
Community Support Team _ Eason