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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

How to combine two columns in a visual that is a table that is joning two other tables in data model

How do I create a visual that is a table that combines two columns into one column? I have a visual that is using data from two separate tables. Here is the join in the data model:

 

join.png

 

 

 

 

 

 

 

 

 

 

 

 

 

I was able to create a visual that shows the two columns, but I want to combine the two columns into one. It is a date field that exists in either one of the two tables (but not both). I want just one combined column. (In the below picture I want to combine "Loading Date" with "STO Load Date"

combine columns.png

 

 

 

 

 

6 REPLIES 6
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario.

TableA:

e1.png

TableB:

e2.png

 

There is a one-to-one relationship between tables.

 

You may create a measure like below.

 

Result = 
var _loadingdate = SELECTEDVALUE(TableA[Loading Date])
var _stoloadingdate = SELECTEDVALUE(TableB[STO Load Date])

return 
IF(
    ISBLANK(_loadingdate),
    _stoloadingdate,
    IF(
        ISBLANK(_stoloadingdate),
        _loadingdate,
        _stoloadingdate
    )
)

 

 

Result:

e4.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

Thanks! I think that is one step away. My data actually does have some rows after my join that are blank for both values. If both values are blank then it should be blank.

 

So, the logic should be this:

If there is an STO Load Date then use STO Load Date, otherwise

If there is a Loading Date, use Loading DAte, otherwise

Return a blank date

 

Here is how the data comes across in PowerBI currently:

load dates.png

 

I created what the results should look like in excel. The third column (column C) I'm trying to create using the measure.

 

excel.png

 

 

 

Greg_Deckler
Community Champion
Community Champion

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 



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...
Ashish_Mathur
Super User
Super User

Hi,

In the ZLIP Table, write this calculated column formula

Date = IF(ISBLANK(ZLIP[Loading Date]),ZLIP[STO Load Date],ZLIP[Loading Date])

Drag this Date field to your visual.

Hope this helps.

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Thanks, that seems like it should work, but my STO Load Date doesn't exist in the ZLIP table. Can I add a column to a table that relies on another table? See screen shot below of the DAX formula I tried. When I write the formula I get an error when trying to reference another table.

 

error.png

 

amitchandak
Super User
Super User

@Anonymous 

Bring the two dates in one column based on the id into one table.  You can have a measure but that will need context every time

Example

New column in Table 1 = maxx(filter(table2,table1[ID] = table2[ID] && table2[Filter]="Filter",table2[Date])

New column in Table 1 = maxx(filter(table2,table1[ID] = table2[ID] && table1[project] = table2[project]),table2[Date])

 

Then using if or in march release, you have coalesce function create a new date column with both.

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.