Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have a perplexing issue.
My data is being imported from an Excel sheet. Power Query automatically changes this to text or a whole number (picture below is of text)
However, if I manually change the data type to Date, it is also incorrect:
I would really just like this to be a Year, formatted as a date. I could even handle 2005-06-15 (middle of the year). I should add that I cannot replace all the years as they are many... so would prefer not to. But right now this is not working for some of the visualizations I'm working with.
Any advice?
Solved! Go to Solution.
Hi @Anonymous
You can open Power Query Editor and add a custom column with below code to get a date column with [Year]. This uses Power Query M function #date. You can change the month and day numbers per your need.
#date(Number.From([Year]), 6, 15)
Then change this new column to Date type.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi @Anonymous
You can open Power Query Editor and add a custom column with below code to get a date column with [Year]. This uses Power Query M function #date. You can change the month and day numbers per your need.
#date(Number.From([Year]), 6, 15)
Then change this new column to Date type.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Thank you!!! This worked for me 🙂 . I've been learning DAX but haven't crossed into the M frontier yet... many thanks again.
@Anonymous - 'Year' by itself is not a date though. It is a whole number. Possibly you need to remove summarization 'sum' from the column in 'Column Tools > Properties' ribbon when you have the field selected?
Proud to be a Super User!
Thanks, Chris. I had tried this earlier (I should have written that in my initial post) but it did not resolve the issue for me.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
56 | |
55 | |
54 | |
37 | |
29 |
User | Count |
---|---|
77 | |
62 | |
45 | |
40 | |
40 |