Forum Discussion

BrianMullen's avatar
BrianMullen
Frequent Visitor
2 years ago
Solved

Help with Count

Hi, I am trying to create a score card to count of how many machines hit the target of 85%

 

The table on the right shows the Score % each machine has got, this is made up of runtime/downtime over several days. When i try to count the machines that have hit or above target (shown in the left table it shows two results for each machine a 0 and 1).

 

Can anyone help with this count?

 

Thanks in advance

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi BrianMullen ,

     

    We can create a new measure [New At Target] to be placed on the visual object instead of the previous measure [At Target].

    New At Target = SUMX(VALUES('Table'[Machine]),[At Target]) 

    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

     

    Best Regards,

    Neeko Tang

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

     

  • Hi All,

     

    Sorry for late reply i could not get the count to work in a card however i created a table and formatted to look like a score card

     

    Score Counter = IF(COUNTROWS(VALUES(Mtable[Machine]))=1,
    [Availability],
    (SUMX(VALUES(Mtable[Machine]),
    IF([Availability]>0.85,1,0))))
     

     

7 Replies

  • ValtteriN's avatar
    ValtteriN
    Community Champion

    Hi,

    Here is one way to do this:

    Data:

     

    Dax:

    Test for 85 = SUMX('Table (22)',IF('Table (22)'[Value]>=0.85,1,0))


    End result:

     

    I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

    My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/

    • BrianMullen's avatar
      BrianMullen
      Frequent Visitor

      Thanks for the suggestion but it has not produced the count, it shows 163672

       

       

  • amustafa's avatar
    amustafa
    Solution Sage

    Did you try to set a filter on the visual on field "At Target" = 1.

    • BrianMullen's avatar
      BrianMullen
      Frequent Visitor

      Hi, yes i tried that. There are 68 machines and each has a 1 and a 0 so shows a score of 68 when only 24 have met the target

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi BrianMullen ,

     

    We can create a new measure [New At Target] to be placed on the visual object instead of the previous measure [At Target].

    New At Target = SUMX(VALUES('Table'[Machine]),[At Target]) 

    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

     

    Best Regards,

    Neeko Tang

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

     

  • BrianMullen's avatar
    BrianMullen
    Frequent Visitor

    Hi All,

     

    Sorry for late reply i could not get the count to work in a card however i created a table and formatted to look like a score card

     

    Score Counter = IF(COUNTROWS(VALUES(Mtable[Machine]))=1,
    [Availability],
    (SUMX(VALUES(Mtable[Machine]),
    IF([Availability]>0.85,1,0))))
     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi BrianMullen ,

       

      Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please feel free to let me know.

       

      Best Regards,

      Neeko Tang