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
Klam
Regular Visitor

Calculate ratings against text values

Hi everyone,

 

I have a table where one of the columns contain text values. In another column, there are some ratings from 0 to 5 against the texts.

I would like to calculate the average or sum of ratings against particular texts/unique texts. How should I go about this please?
Many thanks for your help.

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

Hi @Klam ,

According to your description, I create a sample.

vkalyjmsft_0-1661501114214.png

If you just want to show the sum or average of each Text column, simply put the two columns in a visual and select Sum/Average in the Columns pane.

vkalyjmsft_1-1661501312182.png

If you want to create columns in the table, here's the solution.

Sum =
SUMX (
    FILTER ( 'Table', 'Table'[Text] = EARLIER ( 'Table'[Text] ) ),
    'Table'[Ratings]
)
Average =
AVERAGEX (
    FILTER ( 'Table', 'Table'[Text] = EARLIER ( 'Table'[Text] ) ),
    'Table'[Ratings]
)

Result:

vkalyjmsft_2-1661501664751.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

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

3 REPLIES 3
v-yanjiang-msft
Community Support
Community Support

Hi @Klam ,

According to your description, I create a sample.

vkalyjmsft_0-1661501114214.png

If you just want to show the sum or average of each Text column, simply put the two columns in a visual and select Sum/Average in the Columns pane.

vkalyjmsft_1-1661501312182.png

If you want to create columns in the table, here's the solution.

Sum =
SUMX (
    FILTER ( 'Table', 'Table'[Text] = EARLIER ( 'Table'[Text] ) ),
    'Table'[Ratings]
)
Average =
AVERAGEX (
    FILTER ( 'Table', 'Table'[Text] = EARLIER ( 'Table'[Text] ) ),
    'Table'[Ratings]
)

Result:

vkalyjmsft_2-1661501664751.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

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

 

Thank you so very much! Precisely what I needed! 🙂

Fowmy
Super User
Super User

@Klam 

Please provide some sample or example data. you can somple create your data in Excel and paste here and also show what is the expected out put.

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

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.