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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
im_newbie_123
Frequent Visitor

How to show average and total together in report view

I have to show average = row data total/count of  month number.

Total = column data sum

 

Expected output:

 M1M2M3M4M5M6M7M8M9M10M11M12Average*
John727151525149495352   56
Mary979394949595939795   95
Sam252251249251254259262260266   256
Hans301300299299296294293301295   298
Samuel160153152153159160160157159   157
Henry683689686697717707714717707   702
Zaltan484747514849495154   49
Messi62040424346484952   38
Rolando131314151515141515   14
Total*163216371632165416781674168217001695   1665
1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @im_newbie_123 ,

Try this:

average.PNG

average.gif

 

Attach my PBIX file and the complete code:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bZHBCsIwDIZfRXbeYW3Tdn0DEbzozeGh4EBhbuD04Nvb/Fur3YTtI03Dnz9N0xS74doXZWElQwRoQMaIXIRW8SJ8G/znsin2/vEOB2cZXOIoQSeoVKKXAkd/D7GEskRPiX5zrAlExqDGVKBZCm19P4aDqgSIKud+aEDowdBUKf9aerVdOAr0EhhdwGGM3fd2rrEpn7tqezyQqRXoQLZi8CBWgNUU0yKTSZ189/S8LaoZNmJaVJ1vC2uk1bbacbxxbx6cfRPAkxH7I5NJrdd9GDrfXwaeVSUQRs+R574a5w8=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Name = _t, M1 = _t, M2 = _t, M3 = _t, M4 = _t, M5 = _t, M6 = _t, M7 = _t, M8 = _t, M9 = _t, M10 = _t, M11 = _t, M12 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"M1", Int64.Type}, {"M2", Int64.Type}, {"M3", Int64.Type}, {"M4", Int64.Type}, {"M5", Int64.Type}, {"M6", Int64.Type}, {"M7", Int64.Type}, {"M8", Int64.Type}, {"M9", Int64.Type}}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Name"}, "Attribute", "Value"),
    #"Renamed Columns" = Table.RenameColumns(#"Unpivoted Other Columns",{{"Attribute", "Month"}}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Renamed Columns",{{"Value", Int64.Type}}),
    #"Duplicated Column" = Table.DuplicateColumn(#"Changed Type1", "Month", "Month - Copy"),
    #"Split Column by Position" = Table.SplitColumn(#"Duplicated Column", "Month - Copy", Splitter.SplitTextByPositions({0, 1}, false), {"Month - Copy.1", "Month - Copy.2"}),
    #"Changed Type2" = Table.TransformColumnTypes(#"Split Column by Position",{{"Name", type text}, {"Month - Copy.1", type text}, {"Month - Copy.2", Int64.Type}}),
    #"Removed Columns1" = Table.RemoveColumns(#"Changed Type2",{"Month - Copy.1"})

in
    #"Removed Columns1"

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @im_newbie_123 

 

did you solve your problem?


If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Icey
Community Support
Community Support

Hi @im_newbie_123 ,

Try this:

average.PNG

average.gif

 

Attach my PBIX file and the complete code:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bZHBCsIwDIZfRXbeYW3Tdn0DEbzozeGh4EBhbuD04Nvb/Fur3YTtI03Dnz9N0xS74doXZWElQwRoQMaIXIRW8SJ8G/znsin2/vEOB2cZXOIoQSeoVKKXAkd/D7GEskRPiX5zrAlExqDGVKBZCm19P4aDqgSIKud+aEDowdBUKf9aerVdOAr0EhhdwGGM3fd2rrEpn7tqezyQqRXoQLZi8CBWgNUU0yKTSZ189/S8LaoZNmJaVJ1vC2uk1bbacbxxbx6cfRPAkxH7I5NJrdd9GDrfXwaeVSUQRs+R574a5w8=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Name = _t, M1 = _t, M2 = _t, M3 = _t, M4 = _t, M5 = _t, M6 = _t, M7 = _t, M8 = _t, M9 = _t, M10 = _t, M11 = _t, M12 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"M1", Int64.Type}, {"M2", Int64.Type}, {"M3", Int64.Type}, {"M4", Int64.Type}, {"M5", Int64.Type}, {"M6", Int64.Type}, {"M7", Int64.Type}, {"M8", Int64.Type}, {"M9", Int64.Type}}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Name"}, "Attribute", "Value"),
    #"Renamed Columns" = Table.RenameColumns(#"Unpivoted Other Columns",{{"Attribute", "Month"}}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Renamed Columns",{{"Value", Int64.Type}}),
    #"Duplicated Column" = Table.DuplicateColumn(#"Changed Type1", "Month", "Month - Copy"),
    #"Split Column by Position" = Table.SplitColumn(#"Duplicated Column", "Month - Copy", Splitter.SplitTextByPositions({0, 1}, false), {"Month - Copy.1", "Month - Copy.2"}),
    #"Changed Type2" = Table.TransformColumnTypes(#"Split Column by Position",{{"Name", type text}, {"Month - Copy.1", type text}, {"Month - Copy.2", Int64.Type}}),
    #"Removed Columns1" = Table.RemoveColumns(#"Changed Type2",{"Month - Copy.1"})

in
    #"Removed Columns1"

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @im_newbie_123 ,

 

If you define measures for M1..M12.

Can you set the measures M1..M12 + Average in the column.

Totals on rows is a matrix standard.

 

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.