Forum Discussion
Unpivot removes rows with no/null values - how to keep them?
- 10 years ago
Select Monday to Friday in Query Editor, Go to Transform Tab, Replace Values ---> Replace "null" with "0".
You would see the expected results.
Thank you for your time and suggestion.
Nick,
You probably thought of this already:
1) replace Null with 0 or "No Value"
2) unpivot
3) replace the 0 or "No Value" with Null
- Grumelo8 years ago
Advocate II
I'm having the same issue.
Replacing null by a value is a workaround not the solution.
I don't see any reason to drop null values.
The column exists, the row must exist !
- molegris4 years ago
Advocate IV
Careful thought! If you apply the transformation suggested above by BradleyA, then you loose some information. In the source, 0 and nulls might provide different information. After the transformation, 0 and nulls are now both null and it's impossible to reverse, nor to identify wchich one was what initialy.
- searl4 years agoFrequent Visitor
Exactly this! Although when you swap null dates for 0, unpivot, then convert data type back to date, Power Query converts 0 to 30/12/1899. This is easy enough to then filter out in any further transformations. But just as easy to convert 0 to null then change data type