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

Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register now.

Reply
ramasaurio
Frequent Visitor

Fill values that don't exist with values from another column

I have a table with a column with missing values, I want to fill those missing values with a column in another table.

I created this sample data as an example (sample_data.pbix) : 

 

Table A

datevalue_A
Friday, 13 September, 20241623
Sunday, 15 September, 20249584

 

Table B

datevalue_B
Friday, 13 September, 20245483
Saturday, 14 September, 20249084
Sunday, 15 September, 20241234

 

dates

dateweek_id
Friday, 13 September, 202437
Saturday, 14 September, 202437
Sunday, 15 September, 202438

 

The relationship between the tables are as follows using "date" as the key between them.

ramasaurio_0-1726344497413.png

 

what I need to do is create a column with the values of column "value_A" from Table A, and fill the missing values (in this case the value for September 14th) with the values of "value_B". In this case, the column should have the values: 1623, 9084, 9584, for each date respectively.

I'm not really sure how to determine when a row in Table A doesn't exist. Table dates has the complete set of dates but I should leave that table intact. Table B may or may not have all the values, so I should leave a 0 if both Table A and Table B don't have that particular date.

Does anyone have directions for me to achieve this?

Thanks in advance.

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Read about COALESCE

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

Read about COALESCE

Perfection.

Thank you!

ramasaurio_0-1726362690542.png

 

Edit:

The subtotals looks off, it show the same value as value_A. I'll play with it a bit more and see how it works.

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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