Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Automatically Merge Legend Categories in Pie Chart in Conditional Percentage

Hi,

 

I have pie chart that consists dozens of categories in the legend. Is there any way to automatically merge categories whose percentage is less than a certain value (for example less than 2 %) into one category (let's say named "Others"). As this is a live data, I cannot simply merge the category manually because the percentage could always be changed.

 

 

Thank you for your help.

Vano.

 

  • Hi, Anonymous 

    What is your current data source?

    If your data model is liveconnect,I'm afraid that it is impossible to do that in a pie chart  .  Amitchandak 's method  isn't  feasible for pie chart visual. As of now, the legend of the pie chart does not support the measure type field. 

     

    If you don’t mind converting the data model into import mode, you can create a calculated column as below:

     

    Defect Type2 =
    VAR percentage =
        'Table'[Value] / SUMX ( ALL ( 'Table' ), 'Table'[Value] )
    RETURN
        IF ( percentage <= 0.02, "others", 'Table'[Defect type] )
    

     

     

    Best Regards,
    Community Support Team _ Eason

     

2 Replies

  • v-easonf-msft's avatar
    v-easonf-msft
    Icon for Community Support rankCommunity Support

    Hi, Anonymous 

    What is your current data source?

    If your data model is liveconnect,I'm afraid that it is impossible to do that in a pie chart  .  Amitchandak 's method  isn't  feasible for pie chart visual. As of now, the legend of the pie chart does not support the measure type field. 

     

    If you don’t mind converting the data model into import mode, you can create a calculated column as below:

     

    Defect Type2 =
    VAR percentage =
        'Table'[Value] / SUMX ( ALL ( 'Table' ), 'Table'[Value] )
    RETURN
        IF ( percentage <= 0.02, "others", 'Table'[Defect type] )
    

     

     

    Best Regards,
    Community Support Team _ Eason