Forum Discussion
Calculating data for the day before the selected plus additional filter
- Anonymous6 years ago
thanks a lot! it seems I finally found a solution. now I'm calculating value for the day BEFORE THE SELECTED like that:
var mydate=SELECTEDVALUE(DateTimeTable[date])returnCALCULATE(SUM(Data[AmountUSD]), ALL(DateTimeTable), 'Data'[type]=0, 'Data'[date]=mydate-1)I have no idea what was wrong with the first attempt, also second attempt and n-th attempt, but this one works perfectly.
You have mentioned
"2) DateTimeTable
Actually, date timetable with one column Date with distinct values for dates
"
Make sure your date timetable is continuous table else use power BI calendar command to generate the calendar.
Try to take a max of the selected value. This should even work without selected value.
Var _end_date=(maxx('Date','Date'[Date]))
Use this in =.
Also, test the data without date filter check that another filter is working fine.
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.
amitchandak wrote:You have mentioned
"2) DateTimeTable
Actually, date timetable with one column Date with distinct values for dates
"
Make sure your date timetable is continuous table else use power BI calendar command to generate the calendar.
Try to take a max of the selected value. This should even work without selected value.
Var _end_date=(maxx('Date','Date'[Date]))
Use this in =.
Also, test the data without date filter check that another filter is working fine.
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.
Yep, I'm using calendar command for creating date tables.
Try to take a max of the selected value. This should even work without selected value. - Could you please explain this? Cause I'm receiving an error "too few argument were passed to MAXX function"
yep, I've tested my filter, both filters works perfectly without each other)