Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
551 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
Sometimes the data you are provided can restrict how useful it will be in Power BI. I encountered a recent example where a user had a Month column and a Year column instead of a date column.
On the left is the Excel source and the right shows how the Query Editor has treated the data.
When the user tried to change the data type of each column to Date they encountered problems.
The Month column returned an error and the Year column showed strange dates.
The Month data is not in a recognised date format hence the error message. The Year data is representing the year number as a date.
Power BI stores dates as the number of days that have elapsed since 00/01/1900, e.g. the date 25/07/2024 is stored as the number 45498.
To resolve this and get useful dates is a fairly simple process. First change the data type of each column to Text.
Click the symbol at the top left of each column to change the datatype.
From the Query Editor menu choose Add Column | Custom Column to create a new column. Create an expression which concatenates the contents of each column, separated by a forward slash.
Use this formula to combine the Month and Year columns.
Once you have the new column, change its data type to Date.
Each date is set to the 1st of the month.
You can now use these values as proper dates.
You can learn more about this topic on the following Wise Owl courses:
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2024. All Rights Reserved.