Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Calculate total average

Hi all,

I am calculating a column called "Comletion".

The measurs are 

  • Inspection KPI 2 = COUNT('Inspection Staff'[Form ID])-'Employee Transaction'[84 Hours Rule ]
  • 0 or 1 = IF('Inspection Staff'[Inspection Counts]=00, IF('Inspection'[Inspection KPI 2]<0, 'Inspection Staff'[Inspection Counts]/[84 Hours Rule ],1))
  • Completion =AVERAGEX ( VALUES ( 'Staff'[Staff Name]), 'Inspection'[0 or 1] )
 
All the numbers in hte matrix table are reight. But if I use job name and completion to make a graph, the completion number are wired. And I pull the completion in a card, the number is also wrong.
 
Could anyone help to write a new measure to make the number right in the card and in the graph?
 
Thank you in advance!
Branko
 

 


 

  • Anonymous's avatar
    Anonymous
    3 years ago

    I have already address the issue. I re-write the measure of "completion" as follow:

    Completion for Job = DIVIDE(SUMX(VALUES('Staff'[User Name]),'Inspection'[0 or 1]),COUNTX(VALUES('Staff'[User Name]),'Inspection Staff'[Inspection Counts for Inspection Crew]))
     
    Now the outcoming from both matrix table and graph are equal. 
     

     

     
     

     

4 Replies

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

    Hi Anonymous 

    Are you sure both job name columns in matrix and charts are the same column from the same table?

    • Anonymous's avatar
      Anonymous
      Not applicable

      Yes, they are in the same column and same table.

       

  • v-xiaotang's avatar
    v-xiaotang
    Icon for Community Support rankCommunity Support

    HI Anonymous 

    Thanks for reaching out to us.

    could you share a sample .pbix file for us to troubleshoot? thanks

     

     

    Best Regards,

    Community Support Team _Tang

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

  • Anonymous's avatar
    Anonymous
    Not applicable

    I have already address the issue. I re-write the measure of "completion" as follow:

    Completion for Job = DIVIDE(SUMX(VALUES('Staff'[User Name]),'Inspection'[0 or 1]),COUNTX(VALUES('Staff'[User Name]),'Inspection Staff'[Inspection Counts for Inspection Crew]))
     
    Now the outcoming from both matrix table and graph are equal.