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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

Trying to get the average from a column that has some text fields in

Hi there,

 

I know it sounds silly, but basically I have a column called "result-value" and this column has many different types of values, from numbers to text. The result value's have different types of question sets, some questions sets have no text fields, so I'm completely filtering out the text fields on my report with the filter pane. 

 

KA95_0-1654599080478.png

 

So for example "Question Set 1" (filtered above) is purely just numerical values. However, I can't get the average value of results because the column is obviously a text column. 

 

So I created this measrue below:

 

Average Score = CALCULATE(SUM('Quiz Results'[result_value]), FILTER('Quiz Steps', 'Quiz Steps'[step_name] = "Question Set 1"))

 

Now this doesn't work, and it's obvious why because again the column in question is a text column. Is there any way this can be acheived? Either from a measure or power query? I don't want to delete all the text fields in "result_value" because I need the text fields in there, but I want to be able to make proper use of the numerical fields. Any help would be appreciated. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Managed to find a way that fixed this.

I went into Query Editor, added a new custom column with the following function:

Text.Remove([String],{"A".."z"})

This removed all string values in the new custom column so I had a new results column with just integer values. 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Managed to find a way that fixed this.

I went into Query Editor, added a new custom column with the following function:

Text.Remove([String],{"A".."z"})

This removed all string values in the new custom column so I had a new results column with just integer values. 

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 FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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