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

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.

Reply
sravani9920
Frequent Visitor

Average on multiple columns Using DAX

Hello,
I wants to find the average over multiple columns, Below is the Excel sample data and Col1 to Col11 are the columns to find average and "Average Column" values are average of the Col1:Col11 after rounding and next column is Before rounding.
Note: I should replicate this average Function in the power BI using Dax
Second and third row contains only  numbers so while calculating average we don't find any issue in the power Bi as Excel 
Eg Col1+Col2------+Col11/11,
But first  and third row Contains both Numeric and non numeric it should take average for those Columns which are having numbers only 

1st row 690/7=98.57
4th row 790/8=98.75
Can you please Help me how to achive this logic in power Bi when row has both numeric and non numeric values, Sum all the numbers(By ignoring text) and divide by only column count which has numbers instead of taking all the 11 columns to find average.
I wants to show this Average in the Visualization like Table,Column Chart etc.
Thanks in advance.

Col1Col2Col3Col4Col5Col6Col7Col8Col9Col10Col11Average  
100100100100NANA90NA100NA1009998.57143
10010010010010010010080900608584.54545
1001001001001001001000900707878.18182
100100100100100?90NA100NP1009998.75
2 ACCEPTED SOLUTIONS
Ritaf1983
Super User
Super User

Hi @sravani9920 

Power BI doesn’t calculate across cells like Excel – it works by columns, not by individual cells.
So to compute row-wise averages across multiple columns (while ignoring text), you need to reshape the data – it's a fundamentally different method.

What to do:

  1. Use Unpivot Columns (Col1 to Col11) in Power Query.

  2. Set the data type of the unpivoted column to whole number
    3. replace errors to null 
    You will get the table :

    Ritaf1983_0-1746680171435.png

     

     

    After loading the data you can use DAX formula :
    Average_ = AVERAGEA('Table'[Value])
    Result:
    Ritaf1983_1-1746680324004.png

    The pbix is attached you can follow my steps.
    More information about unpivot :

    https://www.youtube.com/watch?v=ESap6ptV8fI

     

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

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

Ashish_Excel
Super User
Super User

Hi,

This M code in Power Query works

let
    Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Col1", Int64.Type}, {"Col2", Int64.Type}, {"Col3", Int64.Type}, {"Col4", Int64.Type}, {"Col5", type any}, {"Col6", type any}, {"Col7", Int64.Type}, {"Col8", type any}, {"Col9", Int64.Type}, {"Col10", type any}, {"Col11", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each List.Average(List.RemoveNulls(List.Transform(Record.ToList(_), each try Number.From(_) otherwise null))))
in
    #"Added Custom"

Hope this helps.

Ashish_Excel_0-1748922807832.png

 

View solution in original post

5 REPLIES 5
v-veshwara-msft
Community Support
Community Support

Hi @sravani9920 ,

May I ask if the solutions provided has addressed your needs? If so, please consider marking helpful reply as Accepted Solution to help others with similar queries.

If you need any further assistance, feel free to reach out.

Thank you.

v-veshwara-msft
Community Support
Community Support

Hi @sravani9920 ,

Following up to see if your query has been resolved. If any of the responses helped, please consider marking the relevant reply as the 'Accepted Solution' to assist others with similar questions.

If you're still facing issues, feel free to reach out.

Also thanks to @Ashish_Excel for your response.

Thank you.

Ashish_Excel
Super User
Super User

Hi,

This M code in Power Query works

let
    Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Col1", Int64.Type}, {"Col2", Int64.Type}, {"Col3", Int64.Type}, {"Col4", Int64.Type}, {"Col5", type any}, {"Col6", type any}, {"Col7", Int64.Type}, {"Col8", type any}, {"Col9", Int64.Type}, {"Col10", type any}, {"Col11", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each List.Average(List.RemoveNulls(List.Transform(Record.ToList(_), each try Number.From(_) otherwise null))))
in
    #"Added Custom"

Hope this helps.

Ashish_Excel_0-1748922807832.png

 

v-veshwara-msft
Community Support
Community Support

Hi @sravani9920 ,

Thanks for reaching out to Microsoft Fabric Community.

Just checking in to see if you query is resolved and if any responses were helpful. If so, kindly consider marking the helpful reply as 'Accepted Solution' to help others with similar queries. 

Otherwise, feel free to reach out for further assistance.

Thanks to @Ritaf1983 for your valuable response.

Thank you.

Ritaf1983
Super User
Super User

Hi @sravani9920 

Power BI doesn’t calculate across cells like Excel – it works by columns, not by individual cells.
So to compute row-wise averages across multiple columns (while ignoring text), you need to reshape the data – it's a fundamentally different method.

What to do:

  1. Use Unpivot Columns (Col1 to Col11) in Power Query.

  2. Set the data type of the unpivoted column to whole number
    3. replace errors to null 
    You will get the table :

    Ritaf1983_0-1746680171435.png

     

     

    After loading the data you can use DAX formula :
    Average_ = AVERAGEA('Table'[Value])
    Result:
    Ritaf1983_1-1746680324004.png

    The pbix is attached you can follow my steps.
    More information about unpivot :

    https://www.youtube.com/watch?v=ESap6ptV8fI

     

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

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
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 Kudoed Authors