Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi,
I want to show current week and previous week bar in bar chart
I wrote the following expression
Current Week : sum({$<Date={'>=$(=Date(WeekStart(Max(Date)),'DD/MM/YYYY'))<=$(=Date(WeekEnd(Max(Date)),'DD/MM/YYYY'))'}>}[Order Value])
Previous Week: sum({$<Date={'>=$(=Date(WeekStart(Max(Date),-1),'DD/MM/YYYY'))<=$(=Date(WeekEnd(Max(Date),-1),'DD/MM/YYYY'))'}>}[Order Value])
but the weekstart() function which i have used starts the week from Sunday to Saturday
I want the week to start from Monday to Sunday
So the expression which i have wrote gives me the wrong output
can anyone help me
thanks in advance
Try these:
Current Week : Sum({$<Date={'>=$(=Date(WeekStart(Max(Date), 0, 0),'DD/MM/YYYY'))<=$(=Date(WeekEnd(Max(Date), 0, 0),'DD/MM/YYYY'))'}>}[Order Value])
Previous Week: Sum({$<Date={'>=$(=Date(WeekStart(Max(Date),-1, 0),'DD/MM/YYYY'))<=$(=Date(WeekEnd(Max(Date),-1, 0),'DD/MM/YYYY'))'}>}[Order Value])
Try these:
Current Week : Sum({$<Date={'>=$(=Date(WeekStart(Max(Date), 0, 0),'DD/MM/YYYY'))<=$(=Date(WeekEnd(Max(Date), 0, 0),'DD/MM/YYYY'))'}>}[Order Value])
Previous Week: Sum({$<Date={'>=$(=Date(WeekStart(Max(Date),-1, 0),'DD/MM/YYYY'))<=$(=Date(WeekEnd(Max(Date),-1, 0),'DD/MM/YYYY'))'}>}[Order Value])
Thanks sunny
If Sunny answer is correct, please, check it as "Correct Answer"
Hi Gaurav,
Make use of this: inweek(), inweektodate()
Thanks,
Sangram
i didn't get the answer using inweek() ,inweektodate()