Forum Discussion
Using filter with DateDiff
- Anonymous1 year ago
Hi Anonymous,
Try this measure using CALCULATE Function
VAR ExitDate = CALCULATE( MAX('ProjectPhaseMilestones'[ActualEndDate]), 'ProjectPhaseMilestones'[MilestonesName] = "Exit Meeting" ) VAR FinalAuditDate = CALCULATE( MAX('ProjectPhaseMilestones'[ActualEndDate]), 'ProjectPhaseMilestones'[MilestonesName] = "Final Audit Report" )Regards,
Vinay Pabbu
Hi Anonymous,
Thank you for reaching out to Microsoft Fabric Community Forum.
Create a calculated column using below DAX Expression.
Within5BusinessDays =
VAR StartDate = 'Sheet1'[Exit Meeting]
VAR EndDate = 'Sheet1'[Final Audit Report]
VAR BusinessDays =
CALCULATE(
COUNTROWS(
FILTER(
ADDCOLUMNS(
CALENDAR(StartDate, EndDate),
"Weekday", WEEKDAY([Date], 2)
),
[Weekday] <= 5
)
)
)
RETURN IF(BusinessDays <= 5, "Yes", "No")
Result
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Regards,
Vinay Pabbu
Thank you so much! Do I need to specific the column names or filter:
Greatly appreciate your help!!
- Anonymous1 year agoNot applicable
Hi Anonymous,
DAX doesn’t allow filtering like that directly in a column reference. Instead, you need to filter the table and extract the value from the ActualEndDate column where MilestonesName = "Exit Meeting".
Regards,
Vinay Pabbu
- Anonymous1 year agoNot applicable
Hi Vinay,
How do I do that? Filter the table and extract the value from the ActualEndDate column where MilestonesName = "Exit Meeting" and "Final Audit Report".
Thank you!
- Anonymous1 year agoNot applicable
Hi Anonymous,
Try this measure using CALCULATE Function
VAR ExitDate = CALCULATE( MAX('ProjectPhaseMilestones'[ActualEndDate]), 'ProjectPhaseMilestones'[MilestonesName] = "Exit Meeting" ) VAR FinalAuditDate = CALCULATE( MAX('ProjectPhaseMilestones'[ActualEndDate]), 'ProjectPhaseMilestones'[MilestonesName] = "Final Audit Report" )Regards,
Vinay Pabbu