Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi all, I have a question for you.
Do you know what the IF statement would be to find a single character from a field to create a new field?
For example: When field A contains 'T' then create field B. The field A is a text field for example T142536, S18273 etc...
I am trying to create a new field if the search criteria = T within field A
- Babinsky
Solved! Go to Solution.
Hi @Babinsky,
Great to hear the problem got resolved! Could you accept the corresponding reply as solution to help others who may have similar issue easily find the answer and close this thread?
Regards
how about using the left function
=if(left(Field A,1)="T",Field A,"")
Thanks for the suggestions but they didn't work. I found the solution if anyone is curious.
SELECT * FROM file
WHERE field1 LIKE 'T%';
That created the new field I wanted that contained the value T.
Okay then!
Did that work for you? I did it in Excel Power Query just to test it. I can do a screen grab in PBI desktop if you want
Yes it did work, Have a great day everyone!
- Babinsky
Hi @Babinsky,
Great to hear the problem got resolved! Could you accept the corresponding reply as solution to help others who may have similar issue easily find the answer and close this thread?
Regards
Done
I'm assuming you want a new COLUMN
Give this a Try
New Column = IF ( ISERROR ( FIND ( "T", Table[Column], 1 ) ), "No there's no T", "Yes there is a T" )
Hope this helps.
Good Luck!
I saw your reply thanks!
New Column = IF ( ISERROR ( FIND ( "T", Table[Column], 1 ) ), "No there's no T", "Yes there is a T" )
Is the following syntax standard? "No there's no T", "Yes there is a T"
It doesn't look like normal coding procedures. I trying to create a new field based on the contents another.
The question was: "Do you know what the IF statement would be to find a single character from a field to create a new field?"
My Normal Coding Procedures do not include reading minds. But you can output whatever you want
Thanks for offering a suggestion. this is getting me closer sorry for not being clear.
What I'm looking to create is for Example - Field1 contains ex: T000 and S000 and I want to create a new field with T000 only.
Not create a Yes or No value.
Do you want a New Column or a New Table?
This will give you the new COLUMN like in my picture above
New Column = IF ( ISERROR ( FIND ( "T", Table[Column], 1 ) ), BLANK(), Table[Column] )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
100 | |
75 | |
73 | |
49 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |