Forum Discussion

ChanelZheng's avatar
ChanelZheng
Frequent Visitor
6 years ago
Solved

Silcer Value Calculation

Hello,

 

I am trying to work out why a chart is not showing the correct value as it should be:

 

I created a table with a single column called "silent year" and a year slicer

 

AnnualSilentPG = (a * b) / Count(silent phase years selected) (e.g. from 2019 to 2023 = 5)

 

The chart is set up like this:

 

The number shown for each year should be $31,088,000 = 155M / 5, as in the card. 

Instead, it is showing the numerator (a * b) = 155M

 

 

 

 

 

 

 

 

 

 

 

 

I feel like this is something to do with having silent year as x-axis because calculation is correct when display in card. 

 

Please help. Thanks

  • ChanelZheng's avatar
    ChanelZheng
    6 years ago

    Thanks for the reply. 

     

    I gave it a go but still no luck. The dax is as follow:

    AnnualSilentPG = var spg =  COUNT(SilentPhase[SilentYear])
    Return ([Total] * PGContribution[PGContribution Value] * PublicContribution[PublicContribution Value]) / spg

    The chart remain the same with 155M...:smileymad:

  • Hi ChanelZheng 

    Create relationships

     

    Create measures

    Measure(a*b) = SUM(PGContribution[value1])*SUM(PGContribution[value2])
    
    Measure(divide) = [Measure(a*b)]/CALCULATE(COUNT(SilentPhase[year]),ALLSELECTED(SilentPhase))

    Best Regards
    Maggie
    Community Support Team _ Maggie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 Replies

  • When you are viewing it by year. It is actually taking the count as one only.

    Calculate count of year in var first the divide

    AnnualSilentPG = 
    var cn1 =Count(silent phase years selected) 
    Return (a * b) / cn1
    • ChanelZheng's avatar
      ChanelZheng
      Frequent Visitor

      Thanks for the reply. 

       

      I gave it a go but still no luck. The dax is as follow:

      AnnualSilentPG = var spg =  COUNT(SilentPhase[SilentYear])
      Return ([Total] * PGContribution[PGContribution Value] * PublicContribution[PublicContribution Value]) / spg

      The chart remain the same with 155M...:smileymad:

  • v-juanli-msft's avatar
    v-juanli-msft
    Community Support

    Hi ChanelZheng 

    Create relationships

     

    Create measures

    Measure(a*b) = SUM(PGContribution[value1])*SUM(PGContribution[value2])
    
    Measure(divide) = [Measure(a*b)]/CALCULATE(COUNT(SilentPhase[year]),ALLSELECTED(SilentPhase))

    Best Regards
    Maggie
    Community Support Team _ Maggie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
  • v-juanli-msft's avatar
    v-juanli-msft
    Community Support

    Hi ChanelZheng 

    Is this problem sloved? 
    If it is sloved, could you kindly accept it as a solution to close this case?
    If not, please let me know.
     
    Best Regards
    Maggie