Forum Discussion
Anonymous
4 years agoNot applicable
DATEDIFF Returns a Blank()
I am trying to Count Number of records where the ExpiryDate is more than 6 months old. It works fine when the expiryDate is more than 6 months old, however, if it is 0, then it returns Blank() instea...
- 4 years ago
Hi Anonymous ,
Generally, DATEDIFF function can automatically return 0.
You say you want to "Count Number of records where the ExpiryDate is more than 6 months old", so do you have another formula of count?
In my sample, I also create a count measure.
measure = CALCULATE ( COUNT ( location[expiry_date] ), FILTER ( 'location', DATEDIFF ( 'location'[expiry_date], TODAY (), MONTH ) > 1 ) )Get the correct result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Community Champion
4 years agoAnonymous Try:
No_of_Days = DATEDIFF('location'[expiry_date], TODAY(),MONTH) + 0Anonymous
4 years agoNot applicable
Thank you Greg, however, it still displays Blank() in the Card, when the count of records are ZERO, as expiryDate less than 6 months.
- Greg_Deckler4 years ago
Community Champion
Anonymous So what is the formula for expiry_date?
- Anonymous4 years agoNot applicable
ExpiryDate is a Date field in a SQL Direct Query Table