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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
vishnuprashanth
Helper III
Helper III

calculate average across columns for all the selected data

I have a dataset with 80 columns. 

I have filtered the necessary columns and I am trying to calculate the average for across each column for the selected data.

DATASET:

athletetime (mm:ss)Tot EnergyEnergy DiffTotal Dist (m)Acc EVDec EVv<8.00km/h8.00<v<14.40km/h14.40<v<19.60km/h19.60<v<24.00km/h24.00<v<30.00km/hv>30.00km/hmax v (km/h)max P (W/kg)
AKLIOUCHE MAGHNES06:1942219%90002291386.5152.870.10023.2459.55
ARLOTTI ALESSANDRO93:19:0074933147%169488337290.16533.62345.8632.5145.6028.09588.675
BOUREBABA ZINEDDINE14:221592228%330927921.81519.4766.890.510.6025.2570.245
DECARPENTRIE VALENTIN70:47:003307572%724515203008.12592.3983.3462.4197.60.930.04111.29

 

OUTPUT EXPECTED:

 

AverageNaN32037.750.647100.56.2515.52877.752757.951062.175313.87588.450.22526.6562582.44

 

I could achieve this in Excel by the below formula and by dragging it for all my columns. I want to do the same in Power BI.

=AVERAGE(C1:C4)

Output expected in Power BI: 


Output in Power BIOutput in Power BI

 

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @vishnuprashanth

1. select columns from “Total Energy” to the last one except “athlete” and “time (mm:ss)”

    click Transform->unpivot columns

1.png

 

2. Close and apply, then come back to data model view, create a new table

Table1 = SUMMARIZE(FILTER(Sheet1,[athlete]="AKLIOUCHE MAGHNES"),[Attribute],[avg],[time (mm:ss)],[Value],"as","z-avgall")

 

2.png

 

3. Union two tables

Table2 = UNION(Sheet1,Table1)

 

4. Finally, in Report View, use matrix as below

3.png

4.png

 

Here is my pbix

 

Best Regards

Maggie

 

 

View solution in original post

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @vishnuprashanth

1. select columns from “Total Energy” to the last one except “athlete” and “time (mm:ss)”

    click Transform->unpivot columns

1.png

 

2. Close and apply, then come back to data model view, create a new table

Table1 = SUMMARIZE(FILTER(Sheet1,[athlete]="AKLIOUCHE MAGHNES"),[Attribute],[avg],[time (mm:ss)],[Value],"as","z-avgall")

 

2.png

 

3. Union two tables

Table2 = UNION(Sheet1,Table1)

 

4. Finally, in Report View, use matrix as below

3.png

4.png

 

Here is my pbix

 

Best Regards

Maggie

 

 

Thank you so much @v-juanli-msft

I just tried this and it works perfectly. 

I also found an alternate solution by creating HASONEVALUE function for each column and adding it to the report as a separate table. But your solution works better and is comparatively easier. thanks again 🙂 

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.

Top Solution Authors