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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
ABech
Frequent Visitor

Calculation (average) of user ratings using only the latest rating from every respondent

Hello

 

I've been given the task of creating a "real time" rating dashboard of indidual and department workload per week.

 

Each employee has to rate their individual workload, after which I have to calculate the department's average workload. This part itself is pretty straightforward.

The problem is that the employees can continuously update their workload during the week if it changes. I therefore need the department's average workload to be calculated only on the basis of each person's most recent rating.

 

A simplified dataset could, for example, look like this:

 

NameRating    Date (dd-mm-yyyy)    Week
Alan       214-03-202311
Adam414-03-202311
Anna314-03-202311
Anna115-03-202311
Adam315-03-202311
Alan421-03-202312
Anna121-03-202312
Adam321-03-202312
Anna422-03-202312

 

For week 11 i need the average to be 2 based on every respondents latest rating (Alan 14-03-2023 = 2, Anna 15-03-2023 = 1, Adam 15-03-2023= 3), and not the average 2,6 based on all 5 values.

 

The same thing for week 12, where the average should be 3,6 based on the latest rating from each of the 3 respondents ratings and not 3 based on all 4 ratings.

 

How do i make this calculation?

 

I'm going to show the average value for the current week on one page, and on another page i will make a line-chart showing the development of the average rating for each week.

I'm using SQLBI's date template, so I do have a well populated date table.

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

Hi @ABech ,

 

Please try:

Average Workload =
AVERAGEX (
    FILTER (
        ALL ( 'Table' ),
        [Week] = MAX ( 'Table'[Week] )
            && [Date (dd-mm-yyyy)]
                = MAXX (
                    FILTER (
                        'Table',
                        [Week] = MAX ( 'Table'[Week] )
                            && [Name] = EARLIER ( 'Table'[Name] )
                    ),
                    [Date (dd-mm-yyyy)]
                )
    ),
    [Rating]
)

Final output:

vjianbolimsft_0-1678930871274.png

Best Regards,

Jianbo Li

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

2 REPLIES 2
v-jianboli-msft
Community Support
Community Support

Hi @ABech ,

 

Please try:

Average Workload =
AVERAGEX (
    FILTER (
        ALL ( 'Table' ),
        [Week] = MAX ( 'Table'[Week] )
            && [Date (dd-mm-yyyy)]
                = MAXX (
                    FILTER (
                        'Table',
                        [Week] = MAX ( 'Table'[Week] )
                            && [Name] = EARLIER ( 'Table'[Name] )
                    ),
                    [Date (dd-mm-yyyy)]
                )
    ),
    [Rating]
)

Final output:

vjianbolimsft_0-1678930871274.png

Best Regards,

Jianbo Li

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

Hi @v-jianboli-msft 

 

Thank you so much. That seems to work to work perfect!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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