Forum Discussion
Calculate Average Rating
Dear colleagues,
I have a table that consists of ratings of 3 products. I wanted to present all the ratings on a single card in the PBI dashboard. I don't want to create three different measures for each product. You may refer the sample data and dashboard below. Appreciate your help.
| Name | Rating on Product A | Rating on Product B | Rating on Product C |
| Allan | 3 | 1 | 4 |
| Raymer | 4 | 4 | 5 |
| Johnson | 5 | 5 | 1 |
| Donna | 1 | 2 | 4 |
- Anonymous4 years ago
Hi Anonymous ,
Click on the product A column chart and then dynamically get the results of the card, there is no way.
But you can create a slicer and select different products in the slicer to get different results.
1.Create a seperate table.
2.Create a measure.
Average Rating = SWITCH ( SELECTEDVALUE ( 'Table (2)'[Prduct] ), "Product A", AVERAGE ( 'Table'[Rating on Product A] ), "Product B", AVERAGE ( 'Table'[Rating on Product B] ), "Product C", AVERAGE ( 'Table'[Rating on Product C] ) )The result is as follows.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
7 Replies
- amitchandak
Super User
Anonymous , Unpivot the table, split the column on last space into two column and get Product
https://radacad.com/pivot-and-unpivot-with-power-bi
Split Column Power Query: https://youtu.be/FyO9Vmhcfag - Thejeswar
Super User
Hi Anonymous ,
You can unpivot only the 3 product columns so that they apper as single column as shown below
The Table will look as below
You can use this value column in a simple card visual to get the Average across Products
- Tahreem24
Super User
Anonymous If you want to do using measure so do like below:
Total Rating = SUM('Table'[Rating on Product A])+SUM('Table'[Rating on Product B])+SUM('Table'[Rating on Product C])