Forum Discussion
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
- Vijay_A_VermaMost Valuable Professional
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"}) - fooddCommunity Champion
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-Forum/ba-p/963216
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.