March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello,
I am getting this error : Cannot convert value '' of type text to type Date. for this formula:
_Rev. Rec. Term in Days =
DATEDIFF ( [_Rev. Rec. Start Date], [_Rev. Rec. End Date], DAY )
Where:
_Rev. Rec. Start Date =
FORMAT (
DATEVALUE ( MIN ( 'Transaction Lines'[Rev. Rec. Start Date] ) ),
"mm/dd/yyyy"
)
and
_Rev. Rec. End Date =
FORMAT (
DATEVALUE ( MIN ( 'Transaction Lines'[Rev. Rec. End Date] ) ),
"mm/dd/yyyy"
)
Rev. Rec. Start Date and Rev. Rec. End Date are of Date Datatype.
I tried this:
_Rev. Rec. Term in Days =
IF (
ISBLANK ( DATEDIFF ( [_Rev. Rec. Start Date], [_Rev. Rec. End Date], DAY ) ),
BLANK (),
DATEDIFF ( [_Rev. Rec. Start Date], [_Rev. Rec. End Date], DAY )
)and this:
_Rev. Rec. Term in Days =
IF (
ISBLANK ( DATEDIFF ( [_Rev. Rec. Start Date], [_Rev. Rec. End Date], DAY ) ),
0,
DATEDIFF ( [_Rev. Rec. Start Date], [_Rev. Rec. End Date], DAY )
)
But still get the same error.
TIA,
Learner
Is this a calculated column or a measure?
DATEDIFF requires dates and when you add FORMAT you force it to a Text value, so start there.
All the _(underscore ones) are measures:
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
127 | |
82 | |
69 | |
53 | |
44 |
User | Count |
---|---|
202 | |
106 | |
100 | |
64 | |
56 |