Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

Countrows not returning correct numbers

I have 2 tables DImDate and CC Starters and Leavers both connected via 1-n relationship see below. When I try to create a measure using countrows it then returns incorrect result for APR-22 and May-22.

 

However the excel file that is connected to this has following numbers for the months of Apr and May 22 (see below)

Here is the DAX that counts the number of rows 

Total Leavers Count = 
CALCULATE(
 COUNTROWS(
    'CC Starters & Leavers_26_09_23'),
    ALL('DW DimDate'[StandardDate]
    ))
    

 

 

 

 

 

8 Replies

  • pls try this

    Total Leavers Count = 
    CALCULATE(
     COUNTROWS(
        'CC Starters & Leavers_26_09_23'),
        REMOVEFILTERS(),
         VALUES('DW DimDate'[FirstDayOfMonth])
        ))
  • Anonymous's avatar
    Anonymous
    Not applicable

    Thanks Ahmedx 

     

    No that one didnt' work either, The correct count for Apr-22 should be 64 and I am getting 49 

     

    Dont know where the error is 

     

    Total Leavers Count = 
    CALCULATE(
     COUNTROWS(
        'CC Starters & Leavers_26_09_23'),
        REMOVEFILTERS(),
        VALUES(
        ('DW DimDate'[FirstDayOfMonth]
        ))
    )
        
    • Anonymous's avatar
      Anonymous
      Not applicable

      • Ahmedx's avatar
        Ahmedx
        Super User

        I wrote this and you wrote something else

        ЗНАЧЕНИЯ('DW DimDate'[FirstDayOfMonth])

         

    • Anonymous's avatar
      Anonymous
      Not applicable

      Ahmedx 

       

      Yes I did try that column as well, no luck the result is the same , incorrect number