Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

bar chart

 

Hi,

I have a table with a set of funds. Each fund has an 'amount fund' and beongs to a 'sector'.

In a barchart I show the sum of the 'amount fund'  per sector in percentages (green bars).

There are 3 sectors and each sector has a maximum (the pct should stay below this percentage.)

I have created a seperate tabel with 2 columns: 'Sector' and 'Max' (containing the max percentage'

I want to show this maximum in the barchart (black bars) but the heights of the bars don't match with the numbers in the table.

The maximums in the table are

- 60% for Financial Institutions

- 40% for Agribusiness

- 40% for Energy

but the black bars all are at 47% (which is the average of 60%, 40% and 40%).

Does anyone know how to solve this?

Thanks,

Mirjam

 

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI Anonymous,

     

    I think you need to add a condition to filter calculate average based on current label category. 

    Sample measure:

    Average =
    CALCULATE ( AVERAGE ( Table[amount fund] ), VALUES ( Table[Sector] ) )
    

     

    If above not help, please share some sample data for test.


    Regards,

    Xiaoxin Sheng

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Xiaoxin,

      Thanks for your response. Your suggested formula doesn;t work because the formula AVERAGE only has 1 argument (and you gave 2).

       

      This is the formula that I have used for calculating the percentage of the amount fund:

      Pct amounts fund = divide (sum(ELF_Pipeline[Amounts Fund]),CALCULATE(sum(ELF_Pipeline[Amounts Fund]),ALL(ELF_Pipeline)))

       

      Can you see what I did wrong. I'm not sure how I can share the data

       

      Mirjam

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous,

         

        Please share a pbix file with some sample so that we can test and coding formula on it. (you can upload it to onedrive and share link here)

         

        Regards,

        Xiaoxin Sheng