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.
Hi There,
I've got a table with 2 columns year and month. I need to add a column with a specific date format. I can do so by adding a column to the table itself in using Date(year([year]), month([month],1) for example. My question is which formula to use if I want to add this date field in power query editor. "Date" appears to not be recognised.
thanks!
Solved! Go to Solution.
Hi @Anonymous ,
What is your desired result? If you just want to create a custome date with your [Year] and [Month] columns, you could refer to below formula in query editor:
#date([Year],[Month],1)
Result:
You could also refer to date function in M:
https://docs.microsoft.com/en-us/powerquery-m/date-functions
Regards,
Daniel He
I think the easiest way to do this is by creating a Date Table.
Go to Modeling at the top -> New table
At the top enter:
DATE = CALENDAR(DATE(2011,1,1), DATE(2019,12,31)) 'You can change the 2011/2019 dates to whatever you want.
This will create a date data table, link it to your data throgh relationships and you'll be good to go.
thanks for your response. my problem is however that my table only contains the columns 'year' and 'month' and I need to add a custom column in date format. I have a calendar table to which I want to link my table, using this additional column I'm struggling to create.
Hi @Anonymous ,
What is your desired result? If you just want to create a custome date with your [Year] and [Month] columns, you could refer to below formula in query editor:
#date([Year],[Month],1)
Result:
You could also refer to date function in M:
https://docs.microsoft.com/en-us/powerquery-m/date-functions
Regards,
Daniel He
thanks for that, I had tried this, but overlooked the case sensitivy of the date function. am all set now.
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.
User | Count |
---|---|
111 | |
95 | |
77 | |
68 | |
54 |
User | Count |
---|---|
144 | |
105 | |
102 | |
89 | |
63 |