Forum Discussion

Sul's avatar
Sul
Frequent Visitor
3 years ago
Solved

Fill empty table cells with previous cell value

Hello, I am having an issue of empty cells in my cohorted matrix table where values do not change from the previous cohorted month to the next. I would like to have these empty cells show the val...
  • johnyip's avatar
    3 years ago

    Sul , try the following:

     

    I just typed the following without testing since I don't quite know the data you are using and cannot test if they are correct.

     

    Cohorted revenue = 

    VAR SelectedMonth = MAX('Purchases'[Cohort month])

    VAR MaxMonth = CALCULATE(MAXX(ALLSELECTED(Purchases'[Cohort month]),Purchases'[Cohort month]),REMOVEFILTERS(Purchases'[Cohort month]))

    VAR Result = CALCULATE([Revenue],FILTER(ALLSELECTED('Purchases'[Cohort month]),'Purchases'[Cohort month] <= SelectedMonth))

     

    RETURN

    IF(MAX('Purchases'[Cohort month])>MaxMonth,BLANK(),Result)