DAX COUNTROWS returns wrong values

Dinesh Kumar 1 Reputation point
2023-05-22T06:53:17.73+00:00

Below measure (PR_SPL_DATE_CHANGED) returns invalid result for me. When there is no records in the Products[PR_SPL_SALES_DATE] column, it returns the 1 as the output instead of 0.

Likewise it adds +1 with the count of available records. i.e. If 4 records available it returns 5 records.

 

I am not pretty much sure how it returns the +1 value with the COUNTROWS. 

 

Could anyone assist me on this.

 

MIN_RUN_DATE = CALCULATE(MIN(Products[RUN_DATE]), LEFT(Products[RUN_DATE],4) = FORMAT(YEAR(TODAY()),BLANK()))
 
PR_SPL_DATE_CHANGED = IF((CALCULATE(COUNTROWS(VALUES(Products[PR_SPL_SALES_DATE])),
FILTER(Products, LEFT(Products[RUN_DATE],4) = LEFT([MIN_RUN_DATE],4)))) = 1,0,1)
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
37,727 questions
{count} votes