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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
I am new to Power Query and trying to replicate the below excel formula in power query-
IF(A6="P",IF((D6*E6*F6)>=3284,ROUND((D6*E6*F6)/110,0),ROUND((D6*E6*F6)/200,0)),IF(A6="LTL",ROUND((D6*E6*F6)/175,0),0))
Any help is much appreciated!
Solved! Go to Solution.
Of course PQ doesn't know cell reference, so I build a table with column names that refence your excel columns. In the last column ("Result') you see the conditional column.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WClDSUTICYlMgNjQAEUqxOtFKPiE+2CUCwCwINjayMAFRBmhajMByIClzpdhYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [A = _t, D = _t, E = _t, F = _t, expected = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"A", type text}, {"D", Int64.Type}, {"E", Int64.Type}, {"F", Int64.Type}, {"expected", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "D*E*F", each [D]*[E]*[F], type number),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "result", each if [A] = "P" then
if [#"D*E*F"] >= 3284 then
Number.Round([#"D*E*F"]/110,0)
else
Number.Round([#"D*E*F"]/200,0)
else
if [A]="LTL" then
Number.Round([#"D*E*F"]/175,0)
else
0, type number)
in
#"Added Custom1"
Of course PQ doesn't know cell reference, so I build a table with column names that refence your excel columns. In the last column ("Result') you see the conditional column.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WClDSUTICYlMgNjQAEUqxOtFKPiE+2CUCwCwINjayMAFRBmhajMByIClzpdhYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [A = _t, D = _t, E = _t, F = _t, expected = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"A", type text}, {"D", Int64.Type}, {"E", Int64.Type}, {"F", Int64.Type}, {"expected", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "D*E*F", each [D]*[E]*[F], type number),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "result", each if [A] = "P" then
if [#"D*E*F"] >= 3284 then
Number.Round([#"D*E*F"]/110,0)
else
Number.Round([#"D*E*F"]/200,0)
else
if [A]="LTL" then
Number.Round([#"D*E*F"]/175,0)
else
0, type number)
in
#"Added Custom1"
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 10 | |
| 6 | |
| 5 | |
| 4 | |
| 3 |
| User | Count |
|---|---|
| 14 | |
| 11 | |
| 8 | |
| 7 | |
| 6 |