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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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