Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi All!
I have a query that requires me to return the date 10 days ago from yesterday where it only counts Business Days and skips weekends, bank holidays etc.
For Example, yesterdays date was "03/11/2022", I would need the measure to calculate the previous 10 days before this where it is ONLY a business day, so in theory this should return "21/10/2022" as this was 10 Business Days ago, however the below DAX returns "24/10/2022" so this is clearly counting Non Business Days.
Solved! Go to Solution.
@Adam01 Maybe:
Measure =
VAR LastDateExpr = LASTDATE ( 'Calendar'[Date] )
VAR __Table = FILTER('Calendar',[Date] <= LastDateExpr && [Date] >= LastDateExpr - 14 && WEEKDAY([Date],2) < 6)
VAR __Table1 = ADDCOLUMMNS(__Table, "__DaysAgo", COUNTROWS(FILTER(__Table,[Date] >= EARLIER([Date]))))
VAR CalcExpr = MAXX(FILTER(__Table1, [__DaysAgo] = 10),[Date])
RETURN
CalcExpr
@Adam01 Maybe:
Measure =
VAR LastDateExpr = LASTDATE ( 'Calendar'[Date] )
VAR __Table = FILTER('Calendar',[Date] <= LastDateExpr && [Date] >= LastDateExpr - 14 && WEEKDAY([Date],2) < 6)
VAR __Table1 = ADDCOLUMMNS(__Table, "__DaysAgo", COUNTROWS(FILTER(__Table,[Date] >= EARLIER([Date]))))
VAR CalcExpr = MAXX(FILTER(__Table1, [__DaysAgo] = 10),[Date])
RETURN
CalcExpr
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 24 | |
| 12 | |
| 11 | |
| 9 | |
| 8 |