Forum Discussion

foxhound92's avatar
foxhound92
Frequent Visitor
3 years ago

How add a subtotal to a line chart

Hello,

 

I am trying to add the value of a subtotal to a line chart. The subtotal not exist in my data. I need to calculate.

 

I give you an exemple to be more explicit.

 

I have data about GDP of top 10 countries. I also have the total of the world. But I would like to add a subtotal for the others countries and would be the sum of total - sum of top 10 countries.

The difficult it is not about creating the measure but I don't know how I can add the measure to the line chart. The countries are in a one column and I am using as a color legend to my line chart. Maybe I need to create a row to add the information about others countries with a calculate function ?

 

 

Thank you for your help.

 

 

 

 

 

 

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    foxhound92 You could create a disconnected table with your Legend values and include in this the Subtotal legend value. Then you would construct a measure to return the appropriate values for each legend item.

    • foxhound92's avatar
      foxhound92
      Frequent Visitor

      Thank you for your solution.

      Unfortunately I am a beginner with Power BI and It is hard for me to understand and imagine how I can do it.