Forum Discussion

hanssonnor's avatar
hanssonnor
Frequent Visitor
5 years ago
Solved

Calculated Column which measures the next Status based on the last completed one

Hi,   I have a challenging task and currently no idea how to solve it. I have two tables and in one of the tables, I want to create a new calculated column (Next Status).   Table 1 contains invo...
  • camargos88's avatar
    5 years ago

    hanssonnor ,

     

    Try this DAX solution for a new calculated column:

    Next Status = MINX(FILTER(TBL_2, 'TBL_2'[Invoice code]= EARLIER('Table'[Invoice code]) && TBL_2[Sequence Code] > 'Table'[Last Staus] ), TBL_2[Sequence Code]) 

     

  • camargos88's avatar
    5 years ago

    hanssonnor ,

     

    Try this new calculated column:

    CostCenter = 
    CALCULATE(
        DISTINCT(RoutingMaster[Cost Center]),
        FILTER(RoutingMaster, RoutingMaster[Invoice code] = EARLIER('Table'[Invoice code]) && RoutingMaster[Sequence Code] = 
            MINX(FILTER(RoutingMaster, 'RoutingMaster'[Invoice code]= EARLIER('Table'[Invoice code]) && RoutingMaster[Sequence Code] > 'Table'[Last Staus] ), RoutingMaster[Sequence Code]) 
        )
    )