Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello
I would like to generate a condition in which if the "Value 2" column detects that it has "null" then it takes the data from column 1.
| Value 1 | Value 2 |
| 1 | 5 |
| 8 | null |
| 2 | null |
| 10 | 3 |
It should end like this.
| Value 1 | Value 2 |
| 1 | 5 |
| 8 | 8 |
| 2 | 2 |
| 10 | 3 |
Thank you.
Or simply apply a Replace Values step to the column "Value 2".
Table.ReplaceValue(PrevStepName,null,each [Value 1],Replacer.ReplaceValue,{"Value 2"})
I hope this is helpful
I don't recognize this logic:
PrevStepName
That PrevStepName reference needs to be replaced with the previous step name from the Applied Steps. If you are unfamiliar or unable to pass it succesfully - try this approach:
1. In the Applied Steps pane, select the step where you want to insert this code (typically, that's the last step you see there)
2. Press the fx in front of the formula bar - this will insert a manual step for you - AND return the previous step name.
3. Copy this step identifier from the formula bar and insert it in the place of the PrevStepName within the provided code.
4. Now you can copy and paste this updated expression back into the formula bar
I hope this is helpful
Insert this step in Power Query where #"Changed Type" should be replaced with your previous step
Table.FromRecords(List.Transform(Table.ToRecords(#"Changed Type"), (x)=> Record.TransformFields(x, {"Value 2", each if x[Value 2]=null then x[Value 1] else x[Value 2]})))
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 5 | |
| 5 | |
| 4 |