Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
9 | |
8 | |
8 | |
7 |
User | Count |
---|---|
14 | |
12 | |
11 | |
10 | |
9 |