Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

YTD Average - DAX calculation

Dear all,

I'm trying to calculate the YTD Average value - but I would need your help on this KPI & DAX language.

Data are like this:

-> Conformity level (Grade A = OK/NON OK per scan/factory/etc.).

 

So I would need to calculate the average of grade A/period and then make the average from the beginning of this year until a specified period (ex. P5 - or 31st May).

 

Here some data:

 

yearmonthdayCONFORMITYPeriodFactories
2021413OKP04RCR
2021413OKP04RCR
202156OKP05RDM
202156OKP05RDM
202156OKP05RDM
202156OKP05RDM
202156OKP05RDM
2021416OKP04RCC
2021416OKP04RCC
2021418OKP04RCC
2021418OKP04RCC
202153OKP05RCC
202154OKP05RCC
202141OKP04RGU
202141OKP04RGU
202141OKP04RGU
202141OKP04RGU
202141CTRL_NOKP04RGU
202141OKP04RGU
2021412WRNG_NOKP04RGU
2021412WRNG_NOKP04RGU
2021412OKP04RGU
2021412OKP04RGU
2021412OKP04RGU
2021412OKP04RGU
2021429OKP05RGU
2021429OKP05RGU
2021429OKP05RGU
2021429OKP05RGU
2021429OKP05RGU
2021514OKP05RGU
2021514WRNG_NOKP05RGU
2021514OKP05RGU
2021514OKP05RGU
2021514OKP05RGU
2021514OKP05RGU
2021514OKP05RGU
2021514OKP05RGU
2021514OKP05RGU
2021514OKP05RGU
2021514WRNG_NOKP05RGU
2021514OKP05RGU
2021514OKP05RGU

 

I would really appreciate your help.

Best regards

Hervé

 

PS: v-kelly-msft 

  • Anonymous 

    pls try this

    Measure = DIVIDE(CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[CONFORMITY]="OK")),COUNTROWS('Table'))

17 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello,

      Expected output is the average of Grade A (Conforme products) / period. (ex. YTD -> From P1 (beginning of the year) until P4 (or now), the average of grade A from P1 to P4 (or now)).

      Hope I'm clear

      Thanks

      Hervé

      • ryan_mayu's avatar
        ryan_mayu
        Super User

        Anonymous 

        could you pls provide the real output based on the sample data you provided? It will be better if you can provide the calculation logic as well.

  • Good morning, I press my name is pablo and I am from Argentina and I have a problem to get the average talk time of a telephone exchange, AHT calls, if I on the excel calculate with the average function that value gives me correctly but on power bi I do not find the turn, what I do is calculate the total time of conversation but I do not find the way to get that average, I attach a capture of what I have and if anyone can help me thank you very much.-

    Best regards;

    Pablo