Forum Discussion
Anonymous
7 years agoNot applicable
Replace NULL with today's date
I have a table in Query Editor that is the result of a lookup for an end date scenario. What I'd like to do is replace the null values with today's date. I think I could create a calculated colu...
- Anonymous7 years ago
Figured this out.
- In Query Editor, select the column and use Replace Values from the Transform ribbon to replace "null" with "1/1/2019" (quotes not used the dialogue). Hit OK.
- In the Home ribbon, choose Query Editor and find the "Replaced Value" line just created. Power BI will have interpreted 1/1/2019 as #datetime(2019, 1, 1, 0, 0, 0). Replace that string with DateTime.LocalNow() and hit Done.
Anonymous
7 years agoNot applicable
Figured this out.
- In Query Editor, select the column and use Replace Values from the Transform ribbon to replace "null" with "1/1/2019" (quotes not used the dialogue). Hit OK.
- In the Home ribbon, choose Query Editor and find the "Replaced Value" line just created. Power BI will have interpreted 1/1/2019 as #datetime(2019, 1, 1, 0, 0, 0). Replace that string with DateTime.LocalNow() and hit Done.
- Anonymous6 years agoNot applicable
Hi David
I followed your solution but did not see any cells with 2019, 1, 1, 0, 0, 0. Therefore couldn't replace the string with the dateTime.LocalNow() Is there something I did wrong/am missing?
Many thanks
James
- Anonymous4 years agoNot applicable
How can I get this to give me yesterday's instead of today?
Table.ReplaceValue(#"Replaced Value2",null,DateTime.LocalNow(),Replacer.ReplaceValue,{"End Time"})
- a_m_wood4 years agoRegular Visitor
I tried same but didn't work for me. Any suggestions?