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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
SweAusBenno
Frequent Visitor

Combining Tables and Adding Rows

Hi, 

 

Fairly new to Power BI and hoping someone can help. 

 

I am looking for the DAX code in order to create a new table (Table C) from two calculated tables (Table A & Table B).

 

SweAusBenno_0-1630591407443.png

 

Essentially, for each row in Table A the result (Table C) has a seperate row for each item, for each period but does not create non-applicable combinations, for example Green - Flags.

 

Hope that explains what I am looking for, Im supper grateful for any help/thoughts/comments.

 

Thanks!

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@SweAusBenno 

rename the colors column in table B and use DAX to create a table.

Table = 
VAR tbl=ADDCOLUMNS(CROSSJOIN('Table A',TableB),"check",if('Table A'[Colors]=TableB[Color],"Yes"))
return SELECTCOLUMNS(FILTER(tbl,[check]="Yes"),"period",'Table A'[period],"Colors",'Table A'[Colors],"item",TableB[Item])

1.PNG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
ziyabikram96
Helper V
Helper V

create new table c and then us the following dax

 table = crossjoin(table a, table b)

ryan_mayu
Super User
Super User

@SweAusBenno 

rename the colors column in table B and use DAX to create a table.

Table = 
VAR tbl=ADDCOLUMNS(CROSSJOIN('Table A',TableB),"check",if('Table A'[Colors]=TableB[Color],"Yes"))
return SELECTCOLUMNS(FILTER(tbl,[check]="Yes"),"period",'Table A'[period],"Colors",'Table A'[Colors],"item",TableB[Item])

1.PNG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks! That seemed to do the trick 🙂

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.