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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
junyuchew
Frequent Visitor

How to populate values from a table with specified dates to another table with all dates

Hi,

 

I have a table with ProductID and DateID, along with True/False column at specified dates that i would like to populate to another table. Note: There are more than 1000 unique products in the actual tables

 

ProductIDDateID 
4120170501FALSE
4120170801FALSE
4120171101TRUE
4120180101TRUE
4120180601TRUE
10020170401FALSE
10020170801FALSE
10020171101FALSE
10020180201TRUE
10020180501TRUE

 

The other table contains all dates from 20170101 to 20181231, along with their respective ProductID. I want to populate True/False on all DateIDs based on the information above. For example, Product 41 from 20170101 to 20171031 should be False, while 20171101 onwards should be TRUE. Is this possible?

 

 Sample of Table

ProductIDDateid Desired column
4120171024FALSE
4120171025FALSE
4120171026FALSE
4120171027FALSE
4120171028FALSE
4120171029FALSE
4120171030FALSE
4120171031FALSE
4120171101TRUE
4120171102TRUE
4120171103TRUE
4120171104TRUE
4120171105TRUE
4120171106TRUE
4120171107TRUE
4120170116TRUE
4120170117TRUE
4120170118TRUE

.

.

.

 

Thank you!

3 REPLIES 3
ryan_mayu
Super User
Super User

Hi,

 

I suggest you to create a unique column in both table which is ID&date. Then you can go to Edit Quires-> Merge Queries to import the column from the second table to first if the values in unique column are matching.





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

Proud to be a Super User!




Hi Ryan,

 

Pardon my phrasing, but I think you misunderstood me. The "desired column" in the second table does not exist. I would like to create a formula to get the "desired column". My second table only has ProductID and DateID but i want to obtain True/False to each row of dates based on information on the first table.

 

I did some research, but it seems that you can do this using the Complete function in R. Not sure how it can be done in DAX

I think the same way which is to create a unique column and import the value from table A to tabel B (or table B to table A) which has the same values of unique columns.





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

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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