Forum Discussion

jemartin's avatar
jemartin
New Member
7 years ago
Solved

DAX Calculate if statement

Hi,   I am pretty new with DAX and struggling to translate this excel formula into DAX format. I want to calculate the Value based on the criteria; Sales price * qty   (where Sales price >0) Bud...
  • parry2k's avatar
    7 years ago

    jemartin add new column using following expression:

     

    HVIS = 
    SWITCH( 
    TRUE(), Table[Sales Price] > 0, Table[Sales Price] * Table[Qty], Table[Sales Price] = 0 && Table[Budget Price] = 0, Table[Material Cost] * 0.3 * Table[Qty], Table[Sales Price] = 0, Table[Budget Price] * Table[Qty] )

    change column name and table name as per your data model. You can also achieve it with IF but Switch is easy to change/read.