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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

"How to Automatically Update Data with DAX Excluding Weekends"

Hi, I am new to the community, and I am learning to use Power BI.
I want to create a report where the data is automatically updated with the previous day's data. In other words, if it is Tuesday, it will update with Monday's data. However, the problem is that Saturdays and Sundays are not valid, so Monday's data needs to be updated with Friday's data. I have it done statically, but I would like to know if it can be done with DAX.

Migang_0-1720592283047.png

 

1 ACCEPTED SOLUTION

@Anonymous 

maybe you can try to create a flag column in date table 

 

Column =
var _last=maxx(FILTER('Table','Table'[date]<today()&&'Table'[Type]="L"),'Table'[date])
return if ('Table'[date]<=_last,"y")
 
11.PNG
 
and add this new column to filter and set the value to "y"




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@Anonymous 

do you only want to update and display the last workday's data or update and include until last workday's data?

 

could you pls provide some sample data?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Sorry for my English.
I want to update and display until the previous last workday."I have this calendar where 'L' stands for workday and 'F' stands for holiday ."

Migang_0-1720597005298.png

Migang_4-1720597594715.png

 

Migang_2-1720597075490.png

Migang_3-1720597117764.png

 

 

 



@Anonymous 

maybe you can try to create a flag column in date table 

 

Column =
var _last=maxx(FILTER('Table','Table'[date]<today()&&'Table'[Type]="L"),'Table'[date])
return if ('Table'[date]<=_last,"y")
 
11.PNG
 
and add this new column to filter and set the value to "y"




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.