Forum Discussion

mdgene's avatar
mdgene
Icon for Helper I rankHelper I
4 years ago

Cumulative Total to specific date

Please I have a measure that shows the cumulative measure upto specific date. But My measure still show values past the date expected. I have added a screen shot of the result below. 

 

If I use date in place of Month it works, but I will like to see it at month level. (screen shot attached). Please what is your advice

 

This is my dax measure

 

Cummulative Sold max  =
VAR LastSaleDate = CALCULATE(LASTDATE('Forecast Revenue'[Closed Date]),'Forecast Revenue'[Forecast Category] = "sold")
RETURN
IF(SELECTEDVALUE('Date Table'[Date]) >[LastSaleDate] ,
BLANK(),
CALCULATE( 'Key Measures'[Sold],
FILTER(ALLSELECTED('Date Table'),
'Date Table'[Date] <= MAX('Date Table'[Date]) ) ))
 
 
 

 

 


 

4 Replies

  • mdgene , Try like

     

    Cummulative Sold max =
    VAR LastSaleDate = CALCULATE(LASTDATE('Forecast Revenue'[Closed Date]),filter(allselected('Forecast Revenue'),'Forecast Revenue'[Forecast Category] = "sold"))
    RETURN
    CALCULATE( 'Key Measures'[Sold],
    FILTER(ALLSELECTED('Date Table'),
    'Date Table'[Date] <= MAX('Date Table'[Date]) && SELECTEDVALUE('Date Table'[Date]) >[LastSaleDate] ))

     

    I doubt you are using month from date table in first visual

     

    or

     

    Cummulative Sold max =
    VAR LastSaleDate = CALCULATE(LASTDATE('Forecast Revenue'[Closed Date]),filter(allselected('Forecast Revenue'),'Forecast Revenue'[Forecast Category] = "sold"))
    RETURN
    CALCULATE( 'Key Measures'[Sold],
    FILTER(ALLSELECTED('Date Table'),
    'Date Table'[Date] <= MAX('Date Table'[Date]) && SELECTEDVALUE('Date Table'[Date]) < [LastSaleDate] ))

    • mdgene's avatar
      mdgene
      Icon for Helper I rankHelper I

      Hi , I tested the two query, query 1, was returning blank. while query 2 was behaving just like my query. also I am using the date column. Thank you

    • mdgene's avatar
      mdgene
      Icon for Helper I rankHelper I

      I am still on it. I will modify and send over. Thank you