Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I wonder if anyone has figured out how to take 'YYYYMM' as a number field to turn it into a valid time period in power query. I have manged it in Power Bi Desktop, but as i need to do some things on it in power query it does not show.
Any help would be awesome
Iain
Solved! Go to Solution.
Hi @Iaine ,
You could create a new custom column, something like this:
#date(
Number.From(Text.Start(Text.From([dateKeyField]), 4)),
Number.From(Text.End(Text.From([dateKeyField]), 2)),
01
)
This gives me the following output:
Pete
Proud to be a Datanaut!
You can also use math functions to isolate the year and month components.
#date(
Number.IntegerDivide([Column1], 100),
Number.Mod([Column1],100),
1
)
Another option is to use Date.FromText with an explicit Format specification:
Date.FromText(Text.From([Column1]), [Format="yyyyMM"]))
Hi @Iaine ,
You could create a new custom column, something like this:
#date(
Number.From(Text.Start(Text.From([dateKeyField]), 4)),
Number.From(Text.End(Text.From([dateKeyField]), 2)),
01
)
This gives me the following output:
Pete
Proud to be a Datanaut!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.