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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
peterpan
Helper I
Helper I

Analysis from group data

I am working on a table similar to below- 

 

IDProject NameUserActivityFieldUser InputDate
1HCCDJohnATarget Value500005-05-2024
1HCCDJohnATarget StatusOver05-05-2024
1HCCDJohnAObservationNo difficulty05-05-2024
1HCCDMarkBWork StatusComplete06-05-2024
1HCCDMarkBQuality of WorkGood06-05-2024
1HCCDLauraCOverall ObservationNice Team Work07-05-2024
1HCCDLauraCRating507-05-2024
2PCCBNeilATarget Value600004-05-2024
2PCCBNeilATarget StatusOver04-05-2024
2PCCBNeilAObservationSmooth Process04-05-2024
2PCCBMarkBWork StatusComplete08-05-2024
2PCCBMarkBQuality of WorkPoor08-05-2024
2PCCBLauraCOverall ObservationNeed to work on Report Quality15-05-2024
2PCCBLauraCRating315-05-2024



My objective is to create a user wise Remark column which averages User Answer in "Quality of Work" and "Rating" for all IDs to distill the results in following way-

UserLaura's RatingMark's Rating
John4.54
Neil53


I don't know if it can be acieved through UI functions or we need to use dax here. Pls assist.

EDIT: Adding some more context for better clarity, the output table is an illustration to show the desired output. Laura & Mark's rating is an average aggregation of multiple such IDs, two of which are indicated in first table. Also, Mark's "Quality of Work" can have User Input "very good/good/average/poor/not proper" which will be first converted to rating of 1 to 5 (5 being Very Good) and then aggregated as average in the output table. Also, Activity B & C are Assesor Activity.


1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @peterpan ,

 

Thanks for the reply from @Ashish_Mathur  and @AllisonKennedy , please allow me to provide another insight:

 

1. Create a calculated column.

Quality of Work Rating = 
SWITCH(
    'Table'[Field],
    "Quality of Work", SWITCH('Table'[User Input], "Very Good", 5, "Good", 4, "Average", 3, "Poor", 2, "Not Proper", 1),
    BLANK()
)

 

2. Create a calculated table.

Table 2 = 
UNION(
        SELECTCOLUMNS(FILTER('Table', 'Table'[Field] = "Rating"), "ID",'Table'[ID],"User", 'Table'[User], "Rating", 'Table'[User Input]),
        SELECTCOLUMNS(FILTER('Table', 'Table'[Field] = "Quality of Work"),"ID",'Table'[ID], "User", 'Table'[User], "Rating", 'Table'[Quality of Work Rating])
    )

vkaiyuemsft_0-1717659829696.png

 

3. Create a relationship.

vkaiyuemsft_1-1717659838642.png

 

4. Create a measure.

Measure = 
IF(MAX('Table'[Field]) = "Target Value",1)

vkaiyuemsft_2-1717659877532.png

 

You can change the values ​​in the matrix to the average you want.

 

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

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

9 REPLIES 9
Anonymous
Not applicable

Hi @peterpan ,

 

Thanks for the reply from @Ashish_Mathur  and @AllisonKennedy , please allow me to provide another insight:

 

1. Create a calculated column.

Quality of Work Rating = 
SWITCH(
    'Table'[Field],
    "Quality of Work", SWITCH('Table'[User Input], "Very Good", 5, "Good", 4, "Average", 3, "Poor", 2, "Not Proper", 1),
    BLANK()
)

 

2. Create a calculated table.

Table 2 = 
UNION(
        SELECTCOLUMNS(FILTER('Table', 'Table'[Field] = "Rating"), "ID",'Table'[ID],"User", 'Table'[User], "Rating", 'Table'[User Input]),
        SELECTCOLUMNS(FILTER('Table', 'Table'[Field] = "Quality of Work"),"ID",'Table'[ID], "User", 'Table'[User], "Rating", 'Table'[Quality of Work Rating])
    )

vkaiyuemsft_0-1717659829696.png

 

3. Create a relationship.

vkaiyuemsft_1-1717659838642.png

 

4. Create a measure.

Measure = 
IF(MAX('Table'[Field]) = "Target Value",1)

vkaiyuemsft_2-1717659877532.png

 

You can change the values ​​in the matrix to the average you want.

 

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

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

Thanks @Anonymous . Your solution seems to work well. Much appreciated. 

Ashish_Mathur
Super User
Super User

Hi,

Very confusing question.  I see absolutely no connection between the input and output tables.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur , Thanks for pointing that out. I have added some more context in Edits for better clarity.

I still do not understand your question.  Someone who does will help.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
peterpan
Helper I
Helper I

@AllisonKennedy  Laura's rating is the average of many more such ratings which of multiple IDs and below sample data is an illustration to show the desired output.

 

This first table is how the data is stored in database table and I am confused as to which way (power query or dax or something else) would be the most efficient in terms of processing time and perfromance. Maybe a mix of both. Eager to know how.

If I have to use Power query, I guess I'll have to add an identifier column based on activity to identify the Assesor User from the rest in order to pivot them into column.

@peterpan  - so are activities 'B' and 'C' assessors?


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

@AllisonKennedy Yes that's correct. Have added some more context in the Edits.

AllisonKennedy
Community Champion
Community Champion

@peterpan  How do we know that Laura rated Neil 5 and John 4.5 ? Does your sample table on top match the results you're looking for in the distilled sample on the bottom? 

 

There's a few ways you could approach this - either transform the data in Power Query (probably the best option) or use lots of DAX. Even with Power Query transformations you may still need some DAX. 

 

I don't normally say this, but this might be a table where a 'Pivot' transformation on the 'Field' and 'UserInput' columns might be helpful. Then you can put the 'Rating' column in a matrix in the 'Values' and you can put the 'User' in 'Rows' and [Assessor] (this is the part I'm confused on - doesn't appear as those you have a field for this??) in 'Columns'


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

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