Forum Discussion

Giten's avatar
Giten
Regular Visitor
1 year ago

Average in sunburst chart

I'm creating a sunburst chart Microsoft provided (v2.6.0.0). Each value is calculated as the sum of the values of the previous level in hiearchy. Is it possible to calculate it based on the average?

 

Using the example Microsoft provided (with a little edit from my side):

 

 

CategorySubcategoryAreaSales
Category1SC1Asia5
Category1SC1Europe1
Category1SC1North America9
Category1SC2Asia6
Category1SC2Europe2
Category2SC3Asia7
Category2SC3Europe3
Category2SC3North America11
Category2SC4Asia8
Category2SC4Europe4
Category2SC4North America12

 

I need the sales value of SC1 to be 5, not 15. And SC2 needs to be 4, not 8.
Furthermore, I need the sales value of Category1 to be 4,5 (the average of SC1 and SC2), not 5 (the average of the 5 areas).

 

I can't seem to get the table in the right format, I hope it's readable.

8 Replies

  • I tried this chart. SC1 level can use average. However, the higher level will sum up automatically. 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Giten ,

    Please create a new measure.

    Subcategory_Avg_Sales = 
    AVERAGEX(
        SUMMARIZE(
            'Table',
            'Table'[Category],
            'Table'[Subcategory],
            "AverageSales",
            AVERAGE('Table'[Sales])
        ),
        [AverageSales]
    )

    Please check if this is the output you are expecting。

    Best regards,

    Lucy Chen

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

    • Giten's avatar
      Giten
      Regular Visitor

      Hi Lucy Chen,

      Thanks! The table shows the right average (also for Category1 and Category2). However, if I put it in a sunburst, the subcategories and categories are still summed up. I guess that's what ryan_mayu meant.

       

      P.S. I'm new here, how do I attach a pbix?

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Giten ,

        Thank you for your kind reply!

        I apologize for using the wrong visualization.

        I made a lot of attempts. It's true that he can't calculate the average of the previous level (Sunburst), but I found another visualization.

        Although he still can't show the averages of the categories, we can view the averages of the different categories in a table.

        In addition, you need to be a super user to attach files on messages.

        The other option is to put your files in a dropbox, onedrive or googledrive folder and share the link with the community.

        Best regards,

        Lucy Chen

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