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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
mo1988
Helper I
Helper I

Getting the last working day before today

Hi,

In my powerbi report, I am trying to flag as the latest working day as 1 and other days as 0.

Working Days are (Monday -> Friday)
Attached is a sample example of what I am trying to achieve.

mo1988_0-1680539899210.png

Please help - thanks.

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @mo1988 ,

 

Here are the steps you can follow:

1. Create measure.

Measure =
var _today=TODAY()
var _week=WEEKDAY(MAX('Date'[Date]),2)
return
MAXX(
    FILTER(ALL('Date'),
    'Date'[Date]<_today&&NOT( _week) in {6,7}),'Date'[Date])

2. Result:

vyangliumsft_0-1680747769203.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
v-yangliu-msft
Community Support
Community Support

Hi  @mo1988 ,

 

Here are the steps you can follow:

1. Create measure.

Measure =
var _today=TODAY()
var _week=WEEKDAY(MAX('Date'[Date]),2)
return
MAXX(
    FILTER(ALL('Date'),
    'Date'[Date]<_today&&NOT( _week) in {6,7}),'Date'[Date])

2. Result:

vyangliumsft_0-1680747769203.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

amitchandak
Super User
Super User

@mo1988 ,

 

maxx(filter(allselected(Date), date[Date] < date[Date] && weeknum(Date[Date],2) <6) , Date[Date])

 

Also, check

Power BI Workday vs Last Workday- https://youtu.be/MkYLT_GYIbM

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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