Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hello,
I need this DAX to look at a column for the previous working day and is the value is greater than 0 than return the value for the previous working day, otherwise return 0.
Daily VOC =
IF (
CALCULATE (
( SUM ( tblKPIData[VOC (RMA)] ) ),
tblDates[Date]
= IF (
WEEKDAY ( TODAY (), 3 ) < 4,
TODAY () - 1,
TODAY ()
- ( 7 + WEEKDAY ( TODAY (), 3 ) )
)
) > 0,
CALCULATE (
( SUM ( tblKPIData[VOC (RMA)] ) ),
tblDates[Date]
= IF (
WEEKDAY ( TODAY (), 3 ) < 4,
TODAY () - 1,
TODAY ()
- ( 7 + WEEKDAY ( TODAY (), 3 ) )
)
),
0
)My problem is that the DAX to filter by previous working day isn't correct. Apprently it is looking at March 11th (ten days in the past) not 1 buisness day in the past.
IF (
WEEKDAY ( TODAY (), 3 ) < 4,
TODAY () - 1,
TODAY ()
- ( 7 + WEEKDAY ( TODAY (), 3 ) )
)How can I fix this to look at the previous working day?
I've used this DAX to create a COLUMN for returning the previous working day, but that does me no good in a CALCUALTE filter becasue it is a COLUMN and not a MEASURE.
PreviousWorkDay =
MAXX(
FILTER('tblDates','tblDates'[Date] < EARLIER('tblDates'[Date])
&& WEEKDAY('tblDates'[Date],3) <5), /*0=Monday, 6=Sunday --> hence < 5 is Monday to Friday*/
'tblDates'[Date]
)Maybe someone has an alternative solution for me.
Thank you,
- Justair07
Solved! Go to Solution.
@Anonymous Hello, bacically I just wanted the DAX to show previous working day. For example since today is Tuesday 3/26/2019 the returned date should be Monday 3/25/2019. If to day was Monday 3/25/2019 then the returned value should be Friday 3/22/2019. I think I have it now, What do you think? I needed to change the 4 to a 5.
IF (
WEEKDAY ( TODAY (), 3 ) < 5,
TODAY () - 1,
TODAY ()
- ( 7 + WEEKDAY ( TODAY (), 3 ) )
)
Hi,
It would be helpful if you provided a sample of your data to demonstrate what you're looking to do.
Thanks,
Ben
@Anonymous Hello, bacically I just wanted the DAX to show previous working day. For example since today is Tuesday 3/26/2019 the returned date should be Monday 3/25/2019. If to day was Monday 3/25/2019 then the returned value should be Friday 3/22/2019. I think I have it now, What do you think? I needed to change the 4 to a 5.
IF (
WEEKDAY ( TODAY (), 3 ) < 5,
TODAY () - 1,
TODAY ()
- ( 7 + WEEKDAY ( TODAY (), 3 ) )
)
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 53 | |
| 48 | |
| 35 | |
| 14 | |
| 14 |
| User | Count |
|---|---|
| 93 | |
| 79 | |
| 37 | |
| 27 | |
| 25 |