Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

How to show prior entry when month missing

I am trying to create a columnd to show me prior month status but because my months have gaps in them I am getting blanks

 

I have the following data. The first 3 are in my dataset and I am trying to create the 4th

 

Report MonthCustomerStatusPrior Month Status
JanABCRed 
FebABCRedRed
MarchABCYellowRed
AprABCYellowYellow
MayABCGreenYellow
JanDEFRed 
FebDEFYellowRed
MayDEFGreenYellow
JanGHIRed 
MarchGHIYellowRed
MayGHIGreenYellow
  • tamerj1's avatar
    tamerj1
    3 years ago

    Anonymous 

    Please try

    Prior Month Status =
    MAXX (
    TOPN (
    1,
    FILTER (
    CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[Customer] ) ),
    'Table'[Month] < EARLIER ( 'Table'[Month] )
    ),
    'Table'[Month]
    ),
    'Table'[Status]
    )

4 Replies

  • tamerj1's avatar
    tamerj1
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous 

    month is text or date data type?

    • Anonymous's avatar
      Anonymous
      Not applicable

      it's date type

      • tamerj1's avatar
        tamerj1
        Icon for Community Champion rankCommunity Champion

        Anonymous 

        Please try

        Prior Month Status =
        MAXX (
        TOPN (
        1,
        FILTER (
        CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[Customer] ) ),
        'Table'[Month] < EARLIER ( 'Table'[Month] )
        ),
        'Table'[Month]
        ),
        'Table'[Status]
        )