Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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 ARating on Product BRating on Product C
Allan314
Raymer445
Johnson551
Donna124

 

 

 

  • Anonymous's avatar
    Anonymous
    4 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

  • 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

  • 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])
     
     
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Tahreem24 , what about average calculation?

      • Tahreem24's avatar
        Tahreem24
        Icon for Super User rankSuper User

        Anonymous Write AVERAGE instead of SUM in above measure.