Forum Discussion

AussieD's avatar
AussieD
Regular Visitor
2 years ago
Solved

Measure calculating inaccurately

Issue:

I'm using a very simple measure and getting a non-accurate result:

in theory COUNTAX should return 24 since there are 4 zeros among the 28 rows. however in the card on the left you can see that I'm getting 28. i really just want to count the 1's (hits) but can't seem to get any of the aggragate functions to work. pictured above is COUNTAX but i have similar issues with any of the Aggregation functions.

My end goal is for "2024 goal" to be a measure of success rate. Dividing the "Hits"=1 by the total number of logged days to get a percentage. Something like this:

2024 goal =
    DIVIDE(
        COUNTAX('Headcount', [Daily Hit]=1),
        COUNTROWS(Headcount),
        0
    )

But because of the issue described above, this always evaluates to 1.

 

Background information:

Things to know:
1. "Daily Hit" is a calculated column and is working correctly, it assigns either a 1 or a 0 depending on whether or not a technician did enough work for the day relative to their recorded hours.

Daily Hit = 

Var workload = CALCULATE(

    SUM('Daily WOTT'[Hours/ Packet action]),

    FILTER('Daily WOTT', 'Daily WOTT'[Technician]=[Technician])

)

Return if(workload>=([Hours]-.5) && [hours]<>0, 1, 0)

2. two of my tables are related through the date and additionally through a technician table that only contains names so that it can be a 1:* cardinality.

 

So my question is: what else effects Dax Measures that causes abbarent results?

From what i can tell i have everything set up properly and I've formatted things correctly, so i'd like to know what the issue is here, but also what i can check in the future besides the relationships and Dax Libraries.

 

Appreciate any help i can get, Thanks 😁

5 Replies

    • AussieD's avatar
      AussieD
      Regular Visitor

      Greg_Deckler That seems to work, and is the only formula that has worked so far. Thanks for the suggestion 😁

      So then the only thing I'm struggling to undestand is the difference between these two functions:
      COUNTROWS(FILTER('Table', [Column]=x)) this provides the correct result
      COUNTAX('Table', [Column]=x) This provides an incorrect result

      Shouldn't these intrisically work the same way?