Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

How to achieve this in PowerQuery?

Hello, 

 

There is a requirement for me to do calculations in PowerQuery end which I am not sure.

 

KarthikKV_0-1628840753676.png

How to do a calculation from here as 444/166 which is 2.67. I can do this easily in DAX but please do let me know how to achieve in PowerQuery?

 

A column name with Ratio with a value of 2.67.

 

Thanks,

Karthik

 

1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

HI @Anonymous ,

 

I am considering you are having only two records in your table. You can apply below steps:-

image.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8k3MK03MUdJRMjExUYrViVbyy89T0FXIhQkbmpkpxcYCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Job Category" = _t, Count = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Job Category", type text}, {"Count", Int64.Type}}),
    #"Transposed Table" = Table.Transpose(#"Changed Type"),
    #"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"Manual", Int64.Type}, {"Non - manual", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type1", "Custom", each [Manual] / [#"Non - manual"]),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Added Custom", {"Custom"}, "Attribute", "Value"),
    #"Renamed Columns" = Table.RenameColumns(#"Unpivoted Columns",{{"Attribute", "Job Description"}, {"Custom", "count"}}),
    #"Renamed Columns1" = Table.RenameColumns(#"Renamed Columns",{{"Value", "counts"}, {"count", "Divide"}}),
    #"Reordered Columns" = Table.ReorderColumns(#"Renamed Columns1",{"Job Description", "counts", "Divide"})
in
    #"Reordered Columns"

I have added data using enter data you can update source based on your source.

Samarth_18_0-1629008980087.png

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

2 REPLIES 2
Samarth_18
Community Champion
Community Champion

HI @Anonymous ,

 

I am considering you are having only two records in your table. You can apply below steps:-

image.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8k3MK03MUdJRMjExUYrViVbyy89T0FXIhQkbmpkpxcYCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Job Category" = _t, Count = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Job Category", type text}, {"Count", Int64.Type}}),
    #"Transposed Table" = Table.Transpose(#"Changed Type"),
    #"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"Manual", Int64.Type}, {"Non - manual", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type1", "Custom", each [Manual] / [#"Non - manual"]),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Added Custom", {"Custom"}, "Attribute", "Value"),
    #"Renamed Columns" = Table.RenameColumns(#"Unpivoted Columns",{{"Attribute", "Job Description"}, {"Custom", "count"}}),
    #"Renamed Columns1" = Table.RenameColumns(#"Renamed Columns",{{"Value", "counts"}, {"count", "Divide"}}),
    #"Reordered Columns" = Table.ReorderColumns(#"Renamed Columns1",{"Job Description", "counts", "Divide"})
in
    #"Reordered Columns"

I have added data using enter data you can update source based on your source.

Samarth_18_0-1629008980087.png

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Anonymous
Not applicable

Thank you so much @Samarth_18 . Though it seems to be lot of steps in PowerQuery but seems to be achievable. Thanks for your guidance.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.