Forum Discussion
Previous Week Sales - Logic (cumulative)
- 4 years ago
ChristianDGreat , As want to display Last week Trend , Make sure there is no date filter, or if there is date filter it should come from independent date table
LWTD Today =
var _min = TODAY() -WEEKDAY(TODAY(),1) -6 //Sumday week start
var _max = today() -7
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))LWTD Today =
//Date1 is independent Date table, Date is joined with Table
var _today = maxx(allselected(Date1),Date1[Date])
var _min =_today -WEEKDAY(_today ,1) -6 //Sunday week start
var _max = _today -7
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))Need of an Independent Table in Power BI - Exclude: https://youtu.be/lOEW-YUrAbE
ChristianDGreat , As want to display Last week Trend , Make sure there is no date filter, or if there is date filter it should come from independent date table
LWTD Today =
var _min = TODAY() -WEEKDAY(TODAY(),1) -6 //Sumday week start
var _max = today() -7
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
LWTD Today =
//Date1 is independent Date table, Date is joined with Table
var _today = maxx(allselected(Date1),Date1[Date])
var _min =_today -WEEKDAY(_today ,1) -6 //Sunday week start
var _max = _today -7
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
Need of an Independent Table in Power BI - Exclude: https://youtu.be/lOEW-YUrAbE