Forum Discussion
Question re Date Diff (Weeks from Today) - Not Filtering Correctly On Sunday
- 4 years ago
Hi Peppearson ,
Is that you want something like this gif shows?
Please refer the pbix file in the end.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 4 years ago
Hi, thanks for the reply.
This isn't quite what I had in mind - my solution needs to show the date diff from the current date from any data in the past/future.
I've actually received a working solution from stack overflow. The title of the post is Date Diff Calculating Incorrectly When Refreshed On Sunday - https://stackoverflow.com/questions/73335573/date-diff-calculating-incorrectly-when-refreshed-on-sunday.
Peppearson , move both to Sunday or Monday and then try
Weeks From Today 2 =
VAR _date= WEEKDAY('Calendar_Table'[Date],2)
VAR _today= WEEKDAY(Today,2)
RETURN
quotient(datediff(_date,_today,day),7)
- Peppearson4 years agoHelper I
Thank you for your response.
Just to clarify:
VAR _date= WEEKDAY('Calendar_Table'[Date],2) Returns the day number i.e. if the calendar date is a monday it would return 1.
VAR _today= WEEKDAY(Today,2) Returns the day number - Same as above but returns day number for today() function so for today it'd return 5
RETURN
quotient(datediff(_date,_today,day),7) - Returns the remainder of division of the result of date diff/7
As far as I can tell this would not return the "weeks from today" for the calendar dates?
- v-chenwuz-msft4 years agoCommunity Support
Hi Peppearson ,
Is that you want something like this gif shows?
Please refer the pbix file in the end.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Peppearson4 years agoHelper I
Hi, thanks for the reply.
This isn't quite what I had in mind - my solution needs to show the date diff from the current date from any data in the past/future.
I've actually received a working solution from stack overflow. The title of the post is Date Diff Calculating Incorrectly When Refreshed On Sunday - https://stackoverflow.com/questions/73335573/date-diff-calculating-incorrectly-when-refreshed-on-sunday.