Forum Discussion

ANB_13's avatar
ANB_13
Helper I
3 years ago
Solved

Help Excel formula to Dax

Hello everyone,    Please, someone can help me to covert this excel formula to DAX ?   "=IF(OR([@[NATURE CODE 1]]="A",[ @[NATURE CODE 1]]="W");([@[%VOL. CN1]]/100)*[@[GROSS MASS (kg)]];0...
  • rubayatyasmin's avatar
    3 years ago

    Hi, ANB_13 

     

    try this one:

     

    = IF(
    OR(
    TableName[NATURE CODE 1] = "A",
    TableName[NATURE CODE 1] = "W"
    ),
    (TableName[%VOL. CN1] / 100) * TableName[GROSS MASS (kg)],
    0
    ) + IF(
    OR(
    TableName[NATURE CODE 2] = "A",
    TableName[NATURE CODE 2] = "W"
    ),
    (TableName[%Vol. CN2] / 100) * TableName[GROSS MASS (kg)],
    0
    )

     

    replace the table with your appropriate table name.