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
I'm trying to right DAX to read the dates of a number like so "191002" for "2nd October 2019"
I'm using DirectQuery for my data and some items have letters or incorrect formatting such as "2019" instead of "19".
I'm having problems here, because I can't use ISERROR function in columns, and I can't get DATE to work in measures
Any help would be appreciated
Solved! Go to Solution.
Hi @michaelmichael ,
Based on my test, ISERROR() function and DATE() function works fine in Measure, please make sure you are creating a measure.
Below are the measure i created and the result i get based on my own logic.
Measure =
var sv = SELECTEDVALUE(Table_1[date])
var lenth = LEN(sv)
return
IF(lenth=6,DATE(MID(sv,1,2),MID(sv,3,2),MID(sv,5,2)),IF(lenth=8,DATE(MID(sv,1,4),MID(sv,5,2),MID(sv,7,2)),DATE(2099,12,31)))
Your logic might be different, so please share some sample data and your expected result if you need further help. Please make sure you don't have any Confidential Information before sharing data.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @michaelmichael ,
Based on my test, ISERROR() function and DATE() function works fine in Measure, please make sure you are creating a measure.
Below are the measure i created and the result i get based on my own logic.
Measure =
var sv = SELECTEDVALUE(Table_1[date])
var lenth = LEN(sv)
return
IF(lenth=6,DATE(MID(sv,1,2),MID(sv,3,2),MID(sv,5,2)),IF(lenth=8,DATE(MID(sv,1,4),MID(sv,5,2),MID(sv,7,2)),DATE(2099,12,31)))
Your logic might be different, so please share some sample data and your expected result if you need further help. Please make sure you don't have any Confidential Information before sharing data.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 | |
85 | |
69 | |
53 | |
44 |
User | Count |
---|---|
202 | |
106 | |
100 | |
64 | |
56 |