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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
BarryWhitelaw
New Member

Combine 2 tables for variance

Hi

 

I have a spreadsheet that has 2 tabs.  Each tab has a Month column, formatted as Text. Each tab has a value column formatted as currency.

 

When I load these 2 tabs into PowerBi Desktop, I can show each as a table summarising the monthly spend.

 

I need to be able to combine these into 1 table, showing the months but then the spend for each table, ie:

Month       Year 1       Year 2

January    £1000        £1050

February  £1000        £1070

March      £1000        £1090

 

I am adding a New Table via the Module header, then entering code to combine. Constantly getting the same error:

 

      An incomatible join column, ("{Month}) was detected. 'NATURALLEFTOUTERJOIN' doesn't support joins by using columns with  different data tytpe or lineage.

 

I've tried to work out and google why this isn't working and not getting anywhere.

Anyone any ideas?

 

Have enclosed screenshot to show what I'm doing.

 

thanks

Barry

 

(Hopefully I've not broken any forum rules posting this, new to the site (and PowerBi)

20250221_141526.jpg20250221_141352.jpg20250221_141341.jpg

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

If you want a quick and dirty solution, use Power Query to merge the 2 tables on the month column. Expand the merged column to pull in the value from the second table, and untick the "Enable Load" option. That will load one table into your model with the month name and both values.

If you want a cleaner, more extendable method, use Power Query to transform both sheets, appending the appropriate year to both month name columns. Set the type of the column to date if it hasn't been automatically detected.

Append the queries and again untick the "Enable Load"  option on the second table. You will now have 1 table with 2 columns, a date and a value.

Create a date table, marked as a date table, and link it to the combined table.  There's plenty of articles and videos about creating a date table.

Use columns from the date table in your visuals, and you can break the values down however you need to .

View solution in original post

1 REPLY 1
johnt75
Super User
Super User

If you want a quick and dirty solution, use Power Query to merge the 2 tables on the month column. Expand the merged column to pull in the value from the second table, and untick the "Enable Load" option. That will load one table into your model with the month name and both values.

If you want a cleaner, more extendable method, use Power Query to transform both sheets, appending the appropriate year to both month name columns. Set the type of the column to date if it hasn't been automatically detected.

Append the queries and again untick the "Enable Load"  option on the second table. You will now have 1 table with 2 columns, a date and a value.

Create a date table, marked as a date table, and link it to the combined table.  There's plenty of articles and videos about creating a date table.

Use columns from the date table in your visuals, and you can break the values down however you need to .

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.