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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
don_writer
Helper II
Helper II

DAX combine columns from three different tables into every possible combination of those columns

How could I take like columns from three different tables (lets say DivisionCode) and all possible Month/year combinations and build a dynamic table from them.

 

This way we could build slicers that included the DivisionCodes from each of the tables and themselves available based on month and year slicers. So lets say we have a HistoricalEmployee File with only active employees in each month/year. So if Bob worked here a year, he's have twelve entries, one for each month/year combination within that Division. If he moves to a new division then he'd have 11 entries if you filtered his one division and one entry in the new divsion, etc.

Now If Nancy worked here a year but was fired in her 12th month she'd have eleven entries for each month/year combination except her last month. And one entry in a Seperations file that just lists all possible separations and their separation dates.

There is also an OpenPostions file each month/year and some OpenPostions carry over month to month and even year to year. 

 

Now the OpenPositions table may have positions in a new Division so until those people are hired that Division wouldn't be on the HistoricalEmployee table. Consequently if all employees in a Division were Separated one month that combination of division/Month/Year would not exist in the HistoricalEmployee table. etc. 

 

So how do I go about making one large dynamic table that pulled for all possible date/division combinations regardless of what table they were in so that if a Division is added to any table its available to report on for all tables.

 

Does that make sense?

 

Best regards,

~Don

1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

Sample data and output would be great, but probably you are going to use GENERATE or GENERATEALL. So something like:

 

Table 2 = 
VAR __table = GENERATEALL(VALUES('Table22'[Column1]),VALUES('Table22'[Column2]))
VAR __table1 = GENERATEALL(__table,VALUES('Table22'[Column3]))
RETURN
__table1

and then a column like:

 

Column = [Column1] & [Column2] & [Column3]

See Table22 and Table 2 in attached. 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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