DAX COUNTROWS returns wrong values
Dinesh Kumar
1
Reputation point
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)
Community Center | Not monitored
46,273 questions
Sign in to answer