The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello -
Anyone know if there is a DAX formula that can subtract a specific number of working days from a date given? So lets says date is today 9/26/23 and I need to subtract 7 business days from that date which is 9/18/23. Thanks!
You can use the following dax measure
SubtractWorkingDays = VAR StartDate = TODAY() // Replace with your specific date
VAR NumDaysToSubtract = 7 // Replace with the number of business days to subtract
VAR CalendarTable = CALENDAR(StartDate - NumDaysToSubtract, StartDate)
VAR WorkingDaysTable = FILTER(CalendarTable, WEEKDAY([Date], 2) <= 5)
RETURN MAXX(WorkingDaysTable, [Date])
Do I need to make a working days calendar for this dax? Slightly new at using so trying to understand. Thank you!!
Here is the formula I created but in the subtract working days column it is still giving me the same date rather than prior 7 business days before. Thank you!
User | Count |
---|---|
26 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
28 | |
13 | |
12 | |
12 | |
6 |