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
joshua1990
Post Prodigy
Post Prodigy

Replace Null with specific value for specific groups

Hi experts!

I have a column with some null values.

I have 2 additonal columns that display the group:

Group 1 Group 2 Value
A A1 5
A AG null
A A3 6

 

Now, I would like to replace all null values for these groups:

  • If Group 1 = "A"
  • If Group 2 ends with "G"

How would you do this in PQ`?

2 REPLIES 2
Vijay_A_Verma
Super User
Super User

Insert this statement.

Replace source with your previous step. You didn't specify which word should replace null. I assumed joshua will replace null. Please replace joshua with right word

= Table.ReplaceValue(Source,each [Value],each if [Group 1]="A" and Text.EndsWith([Group 2],"G") and [Value]=null then "Joshua" else [Value],Replacer.ReplaceValue,{"Value"})
foodd
Super User
Super User

Please provide your work-in-progress Power BI Desktop file (with sensitive information removed) that covers your issue or question completely in a usable format (not as a screenshot).

https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

This allows members of the Forum to assess the state of the model, report layer, relationships, and any DAX applied.

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.