Forum Discussion
dk_24
Helper I
9 years agoWeek to date sales
Hi All ,
How to implement the below tableau logic in Power BI.
if OrderDate >= DATETRUNC('WEEK',TODAY()) AND OrderDate<= TODAY() then sum(sales) END
Here DATETRUNC('WEEK',TODAY()) ----> Will get the starting date of the week (9/10/2017)
TODAY()---> will get the today's date .
Thanks,
DK.
- Anonymous8 years ago
HI dk_24,
You can use below formula to get the week start date.
WeekStart = [Date] + (1 - WEEKDAY([Date],1))
For your scenario, it will be modified like:
WeekStart = TODAY() + (1 - WEEKDAY(TODAY(),1))
Regards,
Xiaoxin Sheng
1 Reply
- AnonymousNot applicable
HI dk_24,
You can use below formula to get the week start date.
WeekStart = [Date] + (1 - WEEKDAY([Date],1))
For your scenario, it will be modified like:
WeekStart = TODAY() + (1 - WEEKDAY(TODAY(),1))
Regards,
Xiaoxin Sheng