Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello everyone,
Please, someone can help me to covert this excel formula to DAX ?
Thank you very much
Regards
Solved! Go to Solution.
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.
Proud to be a Super User!
Hello,
Thank you very much,
I want it also in M language. Can ou help me please ?
Thank you very much
sure,
let
Source = TableName,
DAXFormula = (Table as table) =>
let
Result1 = if List.Contains({"A", "W"}, Table[NATURE CODE 1]) then (Table[%VOL. CN1] / 100) * Table[GROSS MASS (kg)] else 0,
Result2 = if List.Contains({"A", "W"}, Table[NATURE CODE 2]) then (Table[%Vol. CN2] / 100) * Table[GROSS MASS (kg)] else 0,
FinalResult = Result1 + Result2
in
FinalResult,
CustomColumn = Table.AddColumn(Source, "Converted", each DAXFormula(_))
in
CustomColumn
if my assistance helped you in any way. hit 👍
Proud to be a Super User!
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.
Proud to be a Super User!