Forum Discussion

paris's avatar
paris
Helper V
7 years ago
Solved

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...
  • jdbuchanan71's avatar
    7 years ago

    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)?