Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 9 | |
| 8 | |
| 7 | |
| 6 |