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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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 Solution Authors