Forum Discussion
LASTDATE
Hi All,
Please help!! I was almost there and always find something small causes problem!
I have Monthly F'cast table and Sales table. I was able to calculate 7 days average by city but I also want to display 7 days average by region. When I calculate, I get 7 days average of the city in the bottom of vizualization table is shown as outcome. (Tokyo's 3 for this case...)
Please help! my calculation for this is....
7 days MA = CALCULATE(Sales[7 days MA],LASTDATE(CALENDER[DATE]))
All the best,
LoveParis
Hello paris ,
The problem you are running into is filter context. On the total row for the matrix, because there is no city or region, so CALCULATE(Sales[7 days MA],LASTDATE(CALENDER[DATE])) is getting the last date from the calendar an only calcing for that date
You are going to end up with something like
MA = AVERAGEX ( VALUES ( Sales[City] ), [7 days MA] )
Are you able to share your .pbix file (uploade it to OneDrive or DropBox and share the link)?
2 Replies
- jdbuchanan71Super User
Hello paris ,
The problem you are running into is filter context. On the total row for the matrix, because there is no city or region, so CALCULATE(Sales[7 days MA],LASTDATE(CALENDER[DATE])) is getting the last date from the calendar an only calcing for that date
You are going to end up with something like
MA = AVERAGEX ( VALUES ( Sales[City] ), [7 days MA] )
Are you able to share your .pbix file (uploade it to OneDrive or DropBox and share the link)?
- parisHelper V
Thank you for your help!
All the best,
LoveParis