Forum Discussion
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.
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.
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:
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 🙂
1 Reply
- kameronyorkResolver 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.
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:
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 🙂