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
Migang
Frequent Visitor

"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

@Migang 

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

@Migang 

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!




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

 

 

 



@Migang 

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
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.