Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

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]
    ))
    

 

image.png

 

 

 

 

image.pngimage.pngimage.pngimage.png

8 REPLIES 8
Ahmedx
Super User
Super User

Share sample pbix file to help you.

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
Not applicable

@Ahmedx 

 

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

 

shaikhzdandg_0-1697898630591.png

 

could you share your pbix-file?

Anonymous
Not applicable

image.png

I wrote this and you wrote something else

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

 

Anonymous
Not applicable

No luck with tht column too

 

shaikhzdandg_0-1697898696413.png

 

Ahmedx
Super User
Super User

pls try this

Total Leavers Count = 
CALCULATE(
 COUNTROWS(
    'CC Starters & Leavers_26_09_23'),
    REMOVEFILTERS(),
     VALUES('DW DimDate'[FirstDayOfMonth])
    ))

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.