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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Column with Power Query/ M

Hi, i have following Code:

 

Abba1234_0-1610975342264.png

But for some reason, the last Else doenst work.

 

Any ideas why?

 

Thanks!

1 ACCEPTED SOLUTION
Smauro
Solution Sage
Solution Sage

Hey @Anonymous 

 

Your issue is with Text.StartsWith . When given a null value it returns null so PBI doesn't know what to do with this logical. You have to account for null too. Try:

if [Priority] = null then null else
    if Text.StartsWith([#"Additional info:"]??"""CQN")
    or Text.StartsWith([#"Additional info:"]??"""FQN")
        then Text.BeforeDelimiter(Text.Start([#"Additional info:"], 12), ":")
    else [Priority]

 

It should do the trick.



Cheers




Spyros Mavroforos

Data Consultant


Find me on LinkedIn or drop me an email

eSpyros

View solution in original post

5 REPLIES 5
Smauro
Solution Sage
Solution Sage

Hey @Anonymous 

 

Your issue is with Text.StartsWith . When given a null value it returns null so PBI doesn't know what to do with this logical. You have to account for null too. Try:

if [Priority] = null then null else
    if Text.StartsWith([#"Additional info:"]??"""CQN")
    or Text.StartsWith([#"Additional info:"]??"""FQN")
        then Text.BeforeDelimiter(Text.Start([#"Additional info:"], 12), ":")
    else [Priority]

 

It should do the trick.



Cheers




Spyros Mavroforos

Data Consultant


Find me on LinkedIn or drop me an email

eSpyros

AlB
Community Champion
Community Champion

@Anonymous 

I need either the pbix file (or ine with dummy data thhat reproduces the error) or a complete explanation of the error messages that you get. Otherwise I cannot help.

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

 

 

Anonymous
Not applicable

Hi @AlB ,

 

Thank you for the help!!

 

 

Unbenannt.PNG

AlB
Community Champion
Community Champion

Hi @Anonymous 

What exactly is it that does not work? can you share the pbix?

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

 

Anonymous
Not applicable

Hey @AlB ,

Abba1234_0-1610996785766.png

Thats the result.

 

Abba1234_1-1610996888118.png

In the line, where DoA is, is the Error.

 

 

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.