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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

How can I calculate average for multiple columns?

I have 100+ columns and need an average for each one but don't want to create 100+ measures to compute the average for each one. Is there a faster way to do this, e.g. can I make just one measure and calculate an average for every column inside it?

1 ACCEPTED SOLUTION

@Anonymous 

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

9 REPLIES 9
ryan_mayu
Super User
Super User

@Anonymous 

maybe you can try to unpivot those columns. 

1.png

2.PNG

then you can get different average value by filter the Attribute value.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Thanks @ryan_mayu 

 

I've unpivoted the columns but not sure how I can filter the average by attribute value. I created a measure from the unpivoted column using the below code but this gives an average for all the different columns combined. How do i filter this by attribute now?

average = sum(table[value])/count(table[value])

 

@Anonymous 

could you pls provide the sample data and expected output?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Hi @ryan_mayu ,

 

Not sure how to attach excel files as I don't see the option but I have shown a small subset of my data below. I want to create an average for all the value columns, i.e. value_00 and value_01. In my actual dataset this is about 60 columns so will be cumbersome to create a measure for every column.

 

TagName_00DateTime_00Value_00TagName_01DateTime_01Value_01
xxxx10/01/2022 12:30:00    20yyyy10/01/2022 12:30:0040
xxxx10/01/2022 13:30:00    30yyyy10/01/2022 13:30:0060

@Anonymous 

you can select both value column and unpivot columns

1.PNG2.PNG

if you have 60 value columns, you can select 60 columns and unpivot 

then you can create a measure

average(value)





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Hi @ryan_mayu ,

 

I was able to do this but not sure how I can filter this average by attribute. Where is the option located?

@Anonymous 

What's the expected output based on the sample data you provided?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

@ryan_mayu ,

If I filter by attribute value_00 then I want the average for value_00, i.e. 25, and the same for value_01. Right now if I take average it will just average the entire column and give 37.5

@Anonymous 

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors