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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Pamdelorbe
Frequent Visitor

Assign numeric value to a specific text string to get an average

Hi everyone!

 

I'm analyzing the answers of a survey in order to get the general score of each response.  The issue is that the responses are text strings. Por example "Excellent, "very good", "good", etc". 

 

I guess that first I have to assign a numeric value to each text string. For example, Excellent =5, Very good =4, Good =3, etc. I already try to create a new conditional column but didn't work since I need to multiply the total the count of response by the value assigned to get the total score of each value (i.e. Excellent score =18 x 5). 

 

For example, This is how data looks like. 

Pamdelorbe_1-1666974546871.png

 

What I need is to create a formula that multiply each response (i.e excellent =18) by the assigned value (i.e = 5) then divided the sum of total assigned value by the sum of total count responses in order to get the average score (see below).

 

Parking facilitesCount of Parking facilites (responses)CP Parking Facilities (assigned value)Total
Excellent18590
Very good15460
Good15345
Fair7214
Poor111
Did not use/ notice100
SUM57 210
    
AV. SCORE3.68Sum of total (210) / sum of count responses (57)

 

Any help will be more than welcome!

 

I'm super new in power Bi really appreciate very detailed responses. 

 

Thanks in advance!!

2 ACCEPTED SOLUTIONS
Bifinity_75
Solution Sage
Solution Sage

Hi @Pamdelorbe , try this:

-  Table 1 is something like this

Bifinity_75_0-1666992027537.png

- Table 2 is something like this

Bifinity_75_1-1666992053776.png

- Create this relationship:

 

Bifinity_75_2-1666992145914.png

 

- Create this calculate column:

Bifinity_75_3-1666992192140.png

- Create this measure:

Bifinity_75_4-1666992220746.png

 

- Create another this measure:

Bifinity_75_5-1666992244088.png

 

- Create the measure to the average:

Bifinity_75_6-1666992328295.png

 

 

The result:

Bifinity_75_7-1666992354947.png

 

I hope you works it, Best regards

 

 

 

 

 

 

 

View solution in original post

Hi @Pamdelorbe , you can remove the relationships between the 2 tables, and follow this steps:

- Create (for example) this calculate columns:

Bifinity_75_0-1667341195395.pngBifinity_75_1-1667341227512.png

The result is this:

Bifinity_75_2-1667341258240.png

 

- Create the measures to counts and averages:

Bifinity_75_3-1667341327635.pngBifinity_75_4-1667341349070.pngBifinity_75_5-1667341371029.pngBifinity_75_6-1667341390365.png

 

The result is:

Bifinity_75_7-1667341454675.png

- When you insert the filelds (columns) to design the table, choose Don´t resume in this 2 column:

Bifinity_75_8-1667341810622.pngBifinity_75_9-1667341879944.png

If you have problems let me know, 

Best regards!

 

 

View solution in original post

7 REPLIES 7
Bifinity_75
Solution Sage
Solution Sage

The second measure you don't have to create, it's the calculated column:

Bifinity_75_8-1666993922379.png

 

Hi Binifity, 

 

That was so so helpful! Thanks for take the time to answer with so much details. Millon thanks!!!

 

I just have one more quest. How can I make this scalable for the rest of my survey answers? Do i need to create a calculated colum and both measures for each response... For example this was for parking facilites and I want to get the average result from parking accesability, value for money, etc (same answers range apply: "Excellent", "Very good", "Good", etc..)

 

Million thanks in advance!! 

Hi Pambdelorbe, it is fully scalable.  The only requirement is that the source tables must have the same structure, and the name of the columns must remain the same as long as they are referenced in power query, for example for a type change:

 

Original data source (with another name of column):

Bifinity_75_0-1667038940440.png

 

And error in Power Query, because the column name has changed to apply the type change:

Bifinity_75_1-1667039076318.png

If in power query you have not applied any type of change referring to the columns, and the structure of the table is the same, you can scale it without problems.

I hope I have helped you, greetings

Hi Bifinity, 

I tried to do it for the rest of the responses but unfortunately returning the same value as in "Park Facilities" for "Value for money" and "accessibility".  

 

Pamdelorbe_0-1667326275401.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

the calculated colums are returning the same value as "Park Facilities"

 

Pamdelorbe_1-1667326399289.png

 

It might be related to the relationship between tables?

 

Pamdelorbe_2-1667326631449.png

 

 

Here the desired values:

Pamdelorbe_3-1667326884404.png

 

 

Thanks so much in advance for your time and help! 

Have a great day!

Hi @Pamdelorbe , you can remove the relationships between the 2 tables, and follow this steps:

- Create (for example) this calculate columns:

Bifinity_75_0-1667341195395.pngBifinity_75_1-1667341227512.png

The result is this:

Bifinity_75_2-1667341258240.png

 

- Create the measures to counts and averages:

Bifinity_75_3-1667341327635.pngBifinity_75_4-1667341349070.pngBifinity_75_5-1667341371029.pngBifinity_75_6-1667341390365.png

 

The result is:

Bifinity_75_7-1667341454675.png

- When you insert the filelds (columns) to design the table, choose Don´t resume in this 2 column:

Bifinity_75_8-1667341810622.pngBifinity_75_9-1667341879944.png

If you have problems let me know, 

Best regards!

 

 

Hi Bifinity, 

 

This worked perfectly 👌😁

Thanks so much for your help and time!! 

Bifinity_75
Solution Sage
Solution Sage

Hi @Pamdelorbe , try this:

-  Table 1 is something like this

Bifinity_75_0-1666992027537.png

- Table 2 is something like this

Bifinity_75_1-1666992053776.png

- Create this relationship:

 

Bifinity_75_2-1666992145914.png

 

- Create this calculate column:

Bifinity_75_3-1666992192140.png

- Create this measure:

Bifinity_75_4-1666992220746.png

 

- Create another this measure:

Bifinity_75_5-1666992244088.png

 

- Create the measure to the average:

Bifinity_75_6-1666992328295.png

 

 

The result:

Bifinity_75_7-1666992354947.png

 

I hope you works it, Best regards

 

 

 

 

 

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.