Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
There is a requirement for me to do calculations in PowerQuery end which I am not sure.
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
Solved! Go to Solution.
HI @Anonymous ,
I am considering you are having only two records in your table. You can apply below steps:-
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.
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
HI @Anonymous ,
I am considering you are having only two records in your table. You can apply below steps:-
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.
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
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
99 | |
99 | |
76 | |
66 | |
59 |
User | Count |
---|---|
142 | |
106 | |
103 | |
85 | |
70 |