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
I have the exising data in the below format.
I want to create a new table (not a visualization) with average of these columns which should look somthing like this:
Any help is appreciated.
Thank you
A Table.Group is what you need. See the sample code below
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bZG7DsMgDEX/hTmD8du/UalTlDFDlyx9fH/TFJASkBgQ5+Bry/Ocbutn3d5rmhKSAWXab/vJnIOO+zKdJBMFwSKJEPlAUhXBJpECDCQmM+EiOUkMK5kiapHUFaWXDo8BvCWikg4kZnatAwIh4UAy08DalnDwSGJh8CopcfZRTzmYSk9BCHI49+3xev5eaifBbfDKMuQyszv0EKH8/C/iVBXqR+iqhhUWKld2Cg3sWc20uLIWmfc1X1mNNOuQekGcluUL", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Variables = _t, #"Control Pre" = _t, #"Control Post" = _t, #"Test Pre" = _t, #"Test Post" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Variables", type text}, {"Control Pre", Int64.Type}, {"Control Post", Int64.Type}, {"Test Pre", Int64.Type}, {"Test Post", Int64.Type}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Variables"}, {{"Avg Control Pre", each List.Average([Control Pre]), type nullable number}, {"Avg Control Post", each List.Average([Control Post]), type nullable number}, {"Avg Test Pre", each List.Average([Test Pre]), type nullable number}, {"Avg Test Post", each List.Average([Test Post]), type nullable number}})
in
#"Grouped Rows"
I currently have the query with changed type as attched below:
Will I have to change it
Insert a new step and paste this code in formula bar
= Table.Group(#"Changed Type", {"Variable"}, {{"Avg Control Pre", each List.Average([Control Pre]), type nullable number}, {"Avg Control Post", each List.Average([Control Post]), type nullable number}, {"Avg Test Pre", each List.Average([Test Pre]), type nullable number}, {"Avg Test Post", each List.Average([Test Post]), type nullable number}})
I see this error, can you help?
Hi @Anonymous ,
you need to change the source with your source to make that work
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 10 | |
| 9 | |
| 8 | |
| 7 |