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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
BI_Newbie0503
New Member

Calculate Average of column entries

Hi,

 

i'm a brand new Power BI user and want to calculate the average of column entries, where the status "Aktiv"(Active in german) applies.

BI_Newbie0503_0-1712237403068.png

(The filtered view of my table)

 

I already tried the SUM function, but i always get the error message, that the SUM function cannot use values of type string, which confuses me, since its all float values in column 11

 

Am i missing something obvious?

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

Hi, @BI_Newbie0503 

Thanks @_AAndrade  solution and your solution is great. Has your current issue been resolved? If not, perhaps you can try the following workarounds, Here's the sample data I used:

vjianpengmsft_0-1712540928775.png

vjianpengmsft_1-1712540990355.png

Make sure that your column11 is recognized as a decimal number in Power BI. Then you can try creating a measure like this:

vjianpengmsft_2-1712541148931.png

Column11Average =
AVERAGEX ( FILTER ( 'Table', 'Table'[Column3] = "Aktiv" ), 'Table'[Column11] )

You can use this measure in card or table visuals.

vjianpengmsft_3-1712541371463.png

vjianpengmsft_4-1712541752411.png

If you want to show an average for each row, you can add an ALLSELECTED function on top of the original expression to clear the filtering for the outer table visual row labels.

vjianpengmsft_5-1712541868904.png

 

 

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

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

4 REPLIES 4
v-jianpeng-msft
Community Support
Community Support

Hi, @BI_Newbie0503 

Thanks @_AAndrade  solution and your solution is great. Has your current issue been resolved? If not, perhaps you can try the following workarounds, Here's the sample data I used:

vjianpengmsft_0-1712540928775.png

vjianpengmsft_1-1712540990355.png

Make sure that your column11 is recognized as a decimal number in Power BI. Then you can try creating a measure like this:

vjianpengmsft_2-1712541148931.png

Column11Average =
AVERAGEX ( FILTER ( 'Table', 'Table'[Column3] = "Aktiv" ), 'Table'[Column11] )

You can use this measure in card or table visuals.

vjianpengmsft_3-1712541371463.png

vjianpengmsft_4-1712541752411.png

If you want to show an average for each row, you can add an ALLSELECTED function on top of the original expression to clear the filtering for the outer table visual row labels.

vjianpengmsft_5-1712541868904.png

 

 

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

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

 

_AAndrade
Super User
Super User

Ok. The problem is because the column that you are using to do the average is type string intead of numeric.
Change the data type to numeric on Power Query and that issue will be solved.





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




_AAndrade
Super User
Super User

Hi @BI_Newbie0503,

Please try something like this:

CALCULATE(
      AVERAGE ( Your column name to do the average ),
      FILTER(
                 ALL( Your table Name),
                 Your column Name where you have the condition = "Aktiv"
    )
)
This should work, but if you have any problem, please let me know.





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Thanks for the help, but i still get the error message, that the function average cant use values of type string

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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