Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hello
I have a text column like this:
1234
234E
345A
I want to return the values that are numeric only and have 4 digits only.
I wrote the following but it does not work:
IF(NOT(ISERROR(VALUE([Col1]) && LEN([Col1])=4,"YES")
However it does not return anything.
Any idea?
Solved! Go to Solution.
Col1 is formatted as text
maybe you have some spaces or special characters in Col1 values?
@UsePowerBI , Try like
IF(ISERROR(LEN([Col1])), blank(),if( LEN([Col1])=4,"YES",blank()))
Hi @UsePowerBI
for me it works.
Pay attention to parentheses
Column = IF( NOT(ISERROR(VALUE([Col1]))) && LEN([Col1])=4,"YES")
Yes, I did the parentheses correctly but it does not work.
Maybe the LEN and VALUE cannot go together with an &&?
It returns all blank!
I also tried a calculated column as vALUE([Col1]) and it returns: Cannot convert value 'G257' of type Text to type Number.
Hi @UsePowerBI ,
Works for me too
Regards,
Harsh Nathani
Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!
Can you format the Column as text please and try this?
Hi @UsePowerBI ,
Is below what you need?
Here is the dax expression:
Column = IF(NOT(ISERROR(VALUE('Table (3)'[Column1])))&&LEN('Table (3)'[Column1])=7,"Yes",IF(NOT(ISERROR(VALUE('Table (3)'[Column1])))&&LEN('Table (3)'[Column1])=5,"No"))
Col1 is formatted as text
maybe you have some spaces or special characters in Col1 values?
Hi @UsePowerBI ,
This will give a BLANK().
What is the exact Output you need.
This check or Length = 7 , gives yes, else searches for legth = 5 and gives no
Regards,
Harsh Nathani
Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!
User | Count |
---|---|
85 | |
74 | |
71 | |
68 | |
56 |
User | Count |
---|---|
96 | |
94 | |
92 | |
78 | |
71 |