Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
For the below table, I intend to use an KPI measure to show MTD Sales. But the MTD Sales should show the summary of values until last week. For getting the last week data, I use the expression =if(getselectedcount(Date)=0,num(WeekStart(today()-7)),Date). But I want to use this expression to get the MTD Sales on the KPI measure for last week.
Could you please help me with an expression to get the sum of MTD Sales for last week for the KPI measure
Thank you
Product Group | Week Number | Year | Month | Date | MTD Sales Units |
A Box | W01 2020 | 2020 | Jan 2020 | 2019-12-29 | 41 |
A Box | W02 2020 | 2020 | Jan 2020 | 2020-01-05 | 146 |
A Box | W03 2020 | 2020 | Jan 2020 | 2020-01-12 | 284 |
A Box | W04 2020 | 2020 | Jan 2020 | 2020-01-19 | 410 |
A Box | W05 2020 | 2020 | Jan 2020 | 2020-01-26 | 629 |
A Box | W06 2020 | 2020 | Feb 2020 | 2020-02-02 | 169 |
A Box | W07 2020 | 2020 | Feb 2020 | 2020-02-09 | 289 |
A Box | W08 2020 | 2020 | Feb 2020 | 2020-02-16 | 533 |
A Box | W09 2020 | 2020 | Mar 2020 | 2020-02-23 | 189 |
You could try an expression like this:
Sum({< WeekNumber, Year, Month,[Date]={">=$(=MonthStart(today(),-1))<$(=weekstart(today()))"}>}[MTD Sales Units])
is it possible to get the above expression with Weekstart(today()-7) function alone? because my calendar month start and end dates are different than normal calendar