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

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.

Reply
Anonymous
Not applicable

Calculate Line

Hey,

 

I Try to add a calculated column. the new column will calcualte average number for all the parametes that include the letter "A", for example: In team Sarah the numbers that will be calculated are: 5 + 10 + 10 because they are the only numbers that under parameter that containing the letter "A", and the average will be 8.33.

 

 

Thanks!

 

1 ACCEPTED SOLUTION

Hi @Anonymous,

 

I think you can try to use unpivot column feature in query editor to transform your table.

 

Then you can simply achieve calculate multiple column and filter on header name.

Power Query Unpivot Scenarios


Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Anyone? Please?

Hey,

if you to have the average of the sum of the columns for each row try this
new column name = ('table'[A] + 'table'[A1] + 'table'[A2])/3

Hopefully this is what you are looking for

Regards
Tom


Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

Hey Tom thanks,
There is a formula can indicate how many headers contain the letter "A"?
I'm asking becuase the number 3 can be changed and i prefer to divide formula into formula

Hi @Anonymous,

 

I think you can try to use unpivot column feature in query editor to transform your table.

 

Then you can simply achieve calculate multiple column and filter on header name.

Power Query Unpivot Scenarios


Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hey, unfortunately not! But maybe you can calculate the divisor using something like this:
... / (
IF(ISBLANK('table'[A]),0,1) +
IF(...)+
...
)

But then you have to take about the Divide by 0 thing

Regards
Tom


Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
TomMartens
Super User
Super User

Give the final answer from Vanessa a try: https://community.powerbi.com/t5/Desktop/How-to-do-an-average-of-multiple-columns/m-p/193721/highlig...



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

Hi Tom, First of all thanks for the help. In the formula given by Vanessa, she divided the average of each column by the number of columns. What I need is to make an average of all the numbers under heading A (there are 3 in the example), but the calculation will be by line rather than column. Is there still a way to do this? many thanks!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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