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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
ryanjilka
Frequent Visitor

Average Rows in Matrix when some Columns are Text

I am trying to average rows in my Power Bi matrix but am unable to because my values field contains values that are both text and numeric.  Is there a way to handle this?  Average only the columns which are numeric and not the text columns.  Thanks fo rthe help.

 

ryanjilka_0-1629215787142.png

 

ryanjilka_2-1629215945764.png

 

ryanjilka_1-1629215859763.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ryanjilka ,

 

Then you could try ISTEXT() function.

https://docs.microsoft.com/en-us/dax/istext-function-dax 

Modify the formula as below.

 

_value = IF(ISTEXT(SELECTEDVALUE('Table'[value])),0,SELECTEDVALUE('Table'[value]))

Measure = AVERAGEX(ALL('Table'[id]),[_value])

 

Or ISERROR() function.

https://docs.microsoft.com/en-us/dax/iserror-function-dax 

 

_value = IF(ISERROR(SELECTEDVALUE('Table'[value])+0),0,SELECTEDVALUE('Table'[value])+0)

Measure = AVERAGEX(ALL('Table'[id]),[_value])

 

 

Best Regards,

Jay

View solution in original post

3 REPLIES 3
ryanjilka
Frequent Visitor

It is a little more complecated than "Yes" and "No" and so this doesn't seem to work.  I only want to average the numerics and not the text but I can't because of the type of field.  Is there another way to acomplish this? Thanks!

Anonymous
Not applicable

Hi @ryanjilka ,

 

Then you could try ISTEXT() function.

https://docs.microsoft.com/en-us/dax/istext-function-dax 

Modify the formula as below.

 

_value = IF(ISTEXT(SELECTEDVALUE('Table'[value])),0,SELECTEDVALUE('Table'[value]))

Measure = AVERAGEX(ALL('Table'[id]),[_value])

 

Or ISERROR() function.

https://docs.microsoft.com/en-us/dax/iserror-function-dax 

 

_value = IF(ISERROR(SELECTEDVALUE('Table'[value])+0),0,SELECTEDVALUE('Table'[value])+0)

Measure = AVERAGEX(ALL('Table'[id]),[_value])

 

 

Best Regards,

Jay

Anonymous
Not applicable

Hi @ryanjilka ,

 

Depends on how complicate your column is. If the column only contains "yes" or "no" and the numeric, you could create a measure to replace the value.

Sample data for your reference.

_value = IF(SELECTEDVALUE('Table'[value])="yes"||SELECTEDVALUE('Table'[value])="no",0,SELECTEDVALUE('Table'[value])+0)

Measure = AVERAGEX(ALL('Table'[id]),[_value])

9.PNG

 

Best Regards,

Jay

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.