Forum Discussion
Anonymous
6 years agoNot applicable
Calculating data for the day before the selected plus additional filter
Hi all! I have an issue with creating a report and will be thankful for any help. I have two tables: 1) Data Date Id AmountUSD Type 2019-10-01 111 1000 ...
- 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.
Anonymous
6 years agoNot applicable
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])
return
CALCULATE(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.
v-chuncz-msft
Community Support
6 years agoAnonymous
By the way, you may help accept solution. Your contribution is highly appreciated.
https://www.sqlbi.com/articles/filter-arguments-in-calculate/