The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi,
I am trying to extract month and year form two text fields. It is either embedded in field1 or field2. I have to try field one first and if it can't be extracted from field1, then it should be extracted from field2.
Field1 Field2 ResultField
07184C 70007184c 0718
0RLET 0220RLET 0220
I am using following DAX command for calculated column resultfield
Solved! Go to Solution.
Right, so ISNUMBER isn't working because it is testing if it is a number. It is not, it is text. You probably want:
Column =
IF(
ISERROR(VALUE(LEFT([Field1],4))),
LEFT([Field2],4),
LEFT([Field1],4)
)
See attached.
I don't think 0 padding is the issue.
left(Sales[Field1],4) should return '0718' and why is that not being treated as number is the issue. Unfortunately, i have to use data as received.
Right, so ISNUMBER isn't working because it is testing if it is a number. It is not, it is text. You probably want:
Column =
IF(
ISERROR(VALUE(LEFT([Field1],4))),
LEFT([Field2],4),
LEFT([Field1],4)
)
See attached.
Thanks a ton Greg
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
21 | |
21 | |
18 | |
17 | |
13 |
User | Count |
---|---|
41 | |
38 | |
24 | |
20 | |
20 |