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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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