Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

get dynamic value in a clustered column chart

Hi all,

Hope anybody can help me. I have a table with a demand, I tried many times but failed. the table look like this:

 

I want to show the percentage value in a clustered column chart, but should be able to calculated based on reason and total production of selected dates, for example, if I have selected date from 2021.7.1-2021.7.3, it could callculate percentage A=(41.67+41.67)/(10000+10000+15000)= 0.00238, instead of percentage A=(41.67+41.67)/(10000+15000)=0.0069

 Any assistance would be greatly and sincerely appreciated. 

 

 

  • Hi Anonymous ,

     

    Try to create a measure like below:

    percentage = 
    VAR TOTAL_ = CALCULATE(SUM('Table'[Production]),ALLSELECTED('Table'))
    RETURN DIVIDE(SUM('Table'[Loss]),TOTAL_)

     


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

     

1 Reply

  • V-lianl-msft's avatar
    V-lianl-msft
    Community Support

    Hi Anonymous ,

     

    Try to create a measure like below:

    percentage = 
    VAR TOTAL_ = CALCULATE(SUM('Table'[Production]),ALLSELECTED('Table'))
    RETURN DIVIDE(SUM('Table'[Loss]),TOTAL_)

     


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