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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
acorr
Frequent Visitor

Isolate true values from null in cell that contains both

Hi there, I am working with a column that has data that looks like the below ,each row is a cell. How can I set this column up to present the highest number if there's an existing number only, and a null only if there is no number? 

acorr_1-1712872784224.png

 

 

 

 

6 REPLIES 6
ronrsnfld
Super User
Super User

In Power Query Advanced Editor:

 

    #"Added Custom" = Table.AddColumn(#"Changed Type", "Max Value", each 
        List.Max(
            List.ReplaceValue(
                Text.Split([Column1],","),
                "NULL",
                null,Replacer.ReplaceValue)
                )
            )

Thank you - I am having trouble with adding this; I get the token eof error which I can't seem to resolve.) I don't have much experience with power query but I updated the let in statement to match the formatting to how it was previously (and replaced [Column1], which doesn't appear to be the issue) - any chance you are able to help troubleshoot? 

It's tough to troubleshoot for you when you chose to not supply your code or a data sample as text, but perhaps you could work from the Power Query UI instead.

 

  • Be sure to set the relevant column datatype to Text
  • Add Column
    • Custom Column

ronrsnfld_0-1713226351813.png

 

  • Enter this formula in the formula box:
List.Max(List.Transform(
            List.ReplaceValue(
                Text.Split([Column1],","),
                "NULL",
                null,Replacer.ReplaceValue), each Number.From(_)))

 

Replace [Column1] with whatever your actual column name is.

Thanks so much for your help. The custom way produces "Error" in the field (I did convert to text formula.) Here's what I've got now :

acorr_0-1713276590857.pngacorr_1-1713277124326.png

 

 

The functions work here using the information that you presented. Which seems to be merely a screenshot of a selection dropdown.

 

Unless you can provide sufficient data for me to reproduce your problem, I will not be able to help you troubleshoot.

 

Most likely, the data you presented is not representative of your actual data, but there may be other issues also.

lbendlin
Super User
Super User

Convert your strings into lists. Filter the list to exclude "NULL" .  Convert data type to Int64. Grab List.Max.  

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors