Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
AnneConway1
Frequent Visitor

Help with Dates!

Hey Guys, 

Still a complete novice, but learning as I go. 

I need help with something that is so simple its hurting me! I have monthly reports in one excel workbook all on different sheets. When I import it into PowerBi and select dates for say August, September and October I get an error message saying " data is not recognized as PowerBi cannot define the relationship", any ideas?

 

Thank You! 

 

1 ACCEPTED SOLUTION
AllisonKennedy
Super User
Super User

@AnneConway1  You can use the 'Append' option in Power Query to stack all this data into one big long table. I also recommend a DimDate table too. https://excelwithallison.blogspot.com/2020/04/dimdate-what-why-and-how.html 

 

When you pull the data into Power BI, click 'Transform' then Home > Append Queries as New > three or more tables > select all the months you want in your report (note this is the manual way and you will need to add each month in each month, but is the 'novice' way. Eventually would be good to pull these through automatically as the spreadsheet grows but that requires manual coding). Right click on the the names of the months in the Queries pane on left and untick the 'Enable Load' box. This will ensure you don't pull the data through twice. You can also rename your 'Append1' query to something more meaningful.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

6 REPLIES 6
AllisonKennedy
Super User
Super User

@AnneConway1 Does it need to be one Excel workbook? Going forward can you create one workbook per month, all formatted in the same manner? Then you can use the Get Data > From Folder option. Make sure the table or sheet has the same name each month (ie 'Data' not 'Oct'). Power BI will do all the hard work for you with this option and put all the months into one table. 

 

Is there a Date column in the data? If not, you need to name each file with a date format (ie 2022.10.31) and then you can Extract > Text Before Delimiter > .xlsx for your Custom delimiter. That will give you something you can change type to Date and then relate that to the DimDate table you have added. 

 

Then going forward, anything you put in that folder will be pulled into the Power BI report automatically when you refresh the data. 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Thank you so much, the folder option worked! You are a gem!

AnneConway1
Frequent Visitor

Thank you so much @AllisonKennedy Current feeling like I'll never get the hang of this 😐

@AnneConway1 Don't despair- it's a marathon that takes practice but you'll learn bit by bit. One step at a time!


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Hi @AllisonKennedy I added the DimDate but I still get the same error. 

 

I have one excel workbook with tables for each month (currently Aug - Oct) all formatted in the same manner.

I want to create a month over month report that shows totals for each month on different visuals. Using the last day of the month as the date for each month and then the values associated with that month.

The error I get is basically theat the data is not related.

AllisonKennedy
Super User
Super User

@AnneConway1  You can use the 'Append' option in Power Query to stack all this data into one big long table. I also recommend a DimDate table too. https://excelwithallison.blogspot.com/2020/04/dimdate-what-why-and-how.html 

 

When you pull the data into Power BI, click 'Transform' then Home > Append Queries as New > three or more tables > select all the months you want in your report (note this is the manual way and you will need to add each month in each month, but is the 'novice' way. Eventually would be good to pull these through automatically as the spreadsheet grows but that requires manual coding). Right click on the the names of the months in the Queries pane on left and untick the 'Enable Load' box. This will ensure you don't pull the data through twice. You can also rename your 'Append1' query to something more meaningful.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.