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 August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Update New Column with Data from Other Table

Hello.

I would like to update a custom column with data from a different table.

I have a list of zipcodes with program start dates in one table called DateBeginFootprintZips.

cbrickman_0-1664907928520.png

 

I would like to create a new column in a separate table, iPad_CPM with the BeginDate from DateBeginFootprintZips where the zipcodes match.  For the records in iPad_CPM table that have zips that are not in the first, I would like to update that date to the next day after the max date in DateBeginFootprintZips.  

For example, if the zip in my 2nd table is 30014, I want the new column to have a date of 8/1/2022.  But, if the zip in iPad_CPM is 30012, which is not in the DateBeginFootprintZips table, it should be 8/2/2022, as 8/1/2022 is the Max date.

 

cbrickman_1-1664908662796.png

 

 

 

 

Any help would be very much appreciated.

 

 

 

 

 

1 ACCEPTED SOLUTION

@Anonymous Oh, I missed the +1. I'm not sure how much further I can take this without you posting some sample data and expected output because I'm already starting to get confused.

Column = 
  VAR __zip = [zipcode]
  VAR __Table = FILTER('DateBeginFootprintZips',[Zipcode] = __zip)
RETURN
  IF(COUNTROWS(__Table)+0 = 0, MAX('DateBeginFootprintZips'[DateBegin])+1, MAXX(__Table,[DateBegin]))


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...

View solution in original post

4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

@Anonymous Maybe:

Column = 
  VAR __zip = [zipcode]
  VAR __Table = FILTER('DateBeginFootprintZips',[Zipcode] = __zip)
RETURN
  IF(COUNTROWS(__Table)+0 = 0, MAX('DateBeginFootprintZips'[DateBegin]), MAXX(__Table,[DateBegin]))


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...
Anonymous
Not applicable

Hi Greg,

Thanks for this.  Certainly on the right track.  The start date of 6/6 and 6/13 are only assigned to the corresponding zipcodes.  However, all other zipcodes are assigned to the 8/1 date.  How do I update so that just the corresponding zipcodes are assigned the 8/1, leaving all other zipcodes with no current start date to be assigned 8/2 (Max BeginDate + 1 one day)?

@Anonymous Oh, I missed the +1. I'm not sure how much further I can take this without you posting some sample data and expected output because I'm already starting to get confused.

Column = 
  VAR __zip = [zipcode]
  VAR __Table = FILTER('DateBeginFootprintZips',[Zipcode] = __zip)
RETURN
  IF(COUNTROWS(__Table)+0 = 0, MAX('DateBeginFootprintZips'[DateBegin])+1, MAXX(__Table,[DateBegin]))


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...
Anonymous
Not applicable

Thanks Super User Greg!

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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