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

Difference with working days

Hi,

How can I calculate the difference of sales for example between working days? i have the problem on monday that dax look back at sunday when i need to calculate the difference with friday, not sunday.

 

Thanks a lot.

1 ACCEPTED SOLUTION
kameronyork
Resolver I
Resolver I

If I understand correctly you're trying the find the difference between a value on a certain day and the value from the day prior.  However, if the day selected is a Monday, you want to find the difference between Monday and the previous Friday. 
Dates.png
In this image the red lines are what your formula is doing, but you want it to find the previous the Friday instead.

I believe this can be done with Lookups:
solution.png
An if statement can determine if the selected day is a Monday and will Lookup the value from three days ago instead of one day ago.  In this example I have excluded the calculation from being run on weekends as, from your prompt, it seems those days are being ignored.

I hope this is helpful!
Thanks 🙂

View solution in original post

1 REPLY 1
kameronyork
Resolver I
Resolver I

If I understand correctly you're trying the find the difference between a value on a certain day and the value from the day prior.  However, if the day selected is a Monday, you want to find the difference between Monday and the previous Friday. 
Dates.png
In this image the red lines are what your formula is doing, but you want it to find the previous the Friday instead.

I believe this can be done with Lookups:
solution.png
An if statement can determine if the selected day is a Monday and will Lookup the value from three days ago instead of one day ago.  In this example I have excluded the calculation from being run on weekends as, from your prompt, it seems those days are being ignored.

I hope this is helpful!
Thanks 🙂

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.