Forum Discussion
DateTime.LocalNow to number conversion
Hi all,
I have a table in my report that contains "DateTime.Date(DateTime.LocalNow())" in order to provide a "last refreshed on:" card. What I'd like to do, for a forecasting piece, is only display events after that date.
Our event dates are structured as a whole number in the format "20170323," while DateTime returns a date "3/23/2017," so I need the refresh date as a number in order to filter by "greater than."
When I attempt to convert the date to a whole number data type, it changes to (using the above date) 42817. Any tips?
15 Replies
- RMDNA
Solution Sage
bump - anyone?
- Vvelarde
Community Champion
Hi, in Query Editor with Power Query you can Add a column extracting & concatening your date in the text structure expected.
- RMDNA
Solution Sage
The end goal is to get the date in "whole number" format. I'm able to get the date as text, but I can't change it from there.
"3/24/2017" (DateTime) to "20170324" (Whole Number) - it breaks, returns as "42817"
"3/24/2017" (DateTime) to "3/24/2017" (Text) - success
"3/24/2017" (Text) to "20170324" (Whole Number) - "cannot change type"