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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Merge Tables Dynamically Using Parameters

Hello,

 

I have 3 tables in the following format and I want to dynamically merge (full outer join) 2 tables at any given time on Fiscal Qtr and Fiscal Month based on paramter that I would like specify in Power BI.

 

TABLE 1  FORMAT

Fiscal Qtr     Fiscal Month       Data 1       Data 2     
FY20Q3Month 1Prod AX
FY20Q3Month 1Prod BY
FY20Q3Month 1Prod CZ

 

TABLE 2  FORMAT

Fiscal Qtr     Fiscal Month       Data 1       Data 2     
FY20Q3Month 2Prod AX
FY20Q3Month 2Prod BY
FY20Q3Month 2Prod CZ

 

TABLE 3  FORMAT

Fiscal Qtr     Fiscal Month       Data 1       Data 2     
FY20Q3Month 3Prod AX
FY20Q3Month 3Prod BX
FY20Q3Month 3Prod CZ

 

 

The Fiscal Month in the 3 tables are "Month 1", "Month 2" and "Month 3"

 

I want Power Query to merge on either of following combinations based on user parameters:

 

 ON Table1. Month 1= Table2. Month 2

 ON Table1. Month 1= Table3. Month 3

 ON Table2. Month 2= Table3. Month 3

 

How can this be achieved?

 

1 REPLY 1
edhans
Community Champion
Community Champion

You will need to provide some real data per links below. I'm not going to mock something up that misses your goal. That will waste both of our times.

 

How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum

 

The crux of the matter is though you will dynamically replace the join table names in the Table.NestedJoin() statement, which is easy to do as you are just referring to other tables. I haven't tried this, but I suspect you can even use an if/then/else construct in the table parameters to return the table you want.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.