Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Felipekard
Frequent Visitor

Last day dax

Morning everyone,

 

I has one calendar table, like this:

Days: the days

IS WORKDAY:  1 if is workday, 0 if isn't work day

LAST WORKDAY: the workday -1 

 

I need made this calculated column LAST WORKDAY, below i will put the expect result.

 

 

DAYSIS WORKDAY?LAST WORKDAY
01/01/2023 1 -
02/01/2023101/01/2023
03/01/2023102/01/2023
04/01/2023003/01/2023
05/01/2023103/01/2023
06/01/2023105/01/2023
1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You could create a column like

Last workday =
VAR CurrentDate = 'Date'[Date]
RETURN
    CALCULATE (
        MAX ( 'Date'[Date] ),
        REMOVEFILTERS ( 'Date' ),
        'Date'[Date] < CurrentDate,
        'Date'[Is working day] = 1
    )

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

You could create a column like

Last workday =
VAR CurrentDate = 'Date'[Date]
RETURN
    CALCULATE (
        MAX ( 'Date'[Date] ),
        REMOVEFILTERS ( 'Date' ),
        'Date'[Date] < CurrentDate,
        'Date'[Is working day] = 1
    )

Works great! Thank you my friend. 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.