Forum Discussion

LéaGr's avatar
LéaGr
Helper I
6 years ago
Solved

Create a column from loop

Hi everybody,   I have an issue creating a column from what I feel could come from a "for each" loop. As no function of the sort exists in DAX I am stuck.   Here is a simplified version of my dat...
  • Pragati11's avatar
    6 years ago

    Hi LéaGr ,

     

    You can create a Calculated column as follows using DAX:

     

    TestCol = CALCULATE(
                                        MAX(Table1[Status]),
                                        FILTER(
                                                   ALLSELECTED(Table1), Table1[ID] = EARLIER(Table1[ID])
                                                  )
                                        )
     
    Replace Table1 in above DAX expression with your's table-name.
     
    Thanks,
    Pragati