Data Issue for DateDiff or Daysbetween

Hello @gkavesh,

Thank You for posting your query onto the Forum.

The reason why you’re getting this kind of an error is because you’re simply referencing the naked column/field from the table while creating a measure. Had you been creating a calculated column it would’ve worked but in the case of measure, it needs to be wrapped with the function and in this case it’ll “SELECTEDVALUE()” function.

So based on the condition that you’ve specified below is the measure alongwith the screenshot of the final results provided for the reference -

Days Difference = 
DATEDIFF(
    SELECTEDVALUE( InsData[Date of Service] ) , 
    TODAY() , 
    DAY )

I’m also attaching the working of the PBIX file for the reference purposes alongwith the links of the thread which covers similar types of solutions.

Hoping you find this useful and meets your requirements that you’ve been looking for. :slightly_smiling_face:

Thanks and Warm Regards,
Harsh

DaysBetween - Harsh.pbix (167.7 KB)