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
KA95
Helper III
Helper III

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
KA95
Helper III
Helper III

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
KA95
Helper III
Helper III

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
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.