Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
sheetals
Helper I
Helper I

get an element from list by index after split in Mquery

Hi all,

 I have performed split operation in mquery and it returns result as list I want to obtain the  second element from list in a column How can I aceive that in Mquery?

 

Below is the Mquery and screenshot attached of my query

#"Added Custom" = Table.AddColumn(#"Changed Type Generation", "Custom", each Text.Split([extraction],"T"))

 

list.PNG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Yeah... apart from the fact that the formula will return an error when there is no second element. To avoid this and have null returned instead, you have to use this syntax:

Text.Split([extraction],"T"){1}?

 

View solution in original post

5 REPLIES 5
sheetals
Helper I
Helper I

Got The solution

 

Text.Split([extraction],"T"){1}

Anonymous
Not applicable

Yeah... apart from the fact that the formula will return an error when there is no second element. To avoid this and have null returned instead, you have to use this syntax:

Text.Split([extraction],"T"){1}?

 

It shows this error

Expression.Error: We cannot convert the value null to type Text.
Details:
Value=
Type=[Type]

 

 

I have few null values in column [extraction] hence its showing this error. How can I avoid this with mquery?

Anonymous
Not applicable

Use IF.

Any other way rather then if else?

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.