Forum Discussion

POSPOS's avatar
POSPOS
Post Partisan
2 years ago
Solved

Conditional columns using DAX in Power BI

HI All, I have a requirement to display a new column based on a two other columns from the same table.   Scenario: For each contract no., look for the minimum 'contract received date' and then di...
  • Ahmedx's avatar
    2 years ago

    and you can try this

    DateNew2 = 
    VAR t1 = 'Table'[Contract No.]
    VAR t2 = ALLEXCEPT( 'Table', 'Table'[Contract No.] )
    VAR t3 = CALCULATE( MIN( 'Table'[Contract Received date] ),t2  )
    RETURN 
        CALCULATE(MIN('Table'[Contract Executed Date]),t2,
            'Table'[Contract No.] = t1 && 'Table'[Contract Received date] = t3
        )