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

get one table from another using join

Hi,

I have a somewhat weird case that I'm trying to solve. Have a one-many relationship between two tables. I need one column from my many table into the other by using a calculated column. Would like to solve this by getting the value of max date in the many column.

Example, Items and sales. Sales has date value and a status of inventory.
I would like to add inventory to my Items table with value being max date for each item.

 

Is this possible?

 

Thanks! 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Figured this out by using this formula:

CALCULATE(LASTNONBLANKVALUE(Table1[Column1], FIRSTNONBLANK(Table1[Column2], 1)))

View solution in original post

4 REPLIES 4
v-xiaoyan-msft
Community Support
Community Support

Hi@Anonymous ,

 

Has your problem been solved? if so, please consider Accept a correct reply as the solution to help others find it.
 

Best Regards,

Caitlyn Yan

Anonymous
Not applicable

Figured this out by using this formula:

CALCULATE(LASTNONBLANKVALUE(Table1[Column1], FIRSTNONBLANK(Table1[Column2], 1)))
TomMartens
Super User
Super User

Hey @Anonymous , this DAX snippet will tackle the challenge you are facing:

pull data into the one table =
MAXX(
    'many-side-table'
    ,'many-side-table'[column of interest]
)

If this does not solve your problem, create a pbix that contains sample data, upload the pbix to onedrive or dropbox and share the link. If you are using Excel to create the sample data share the xlsx as well.

Also describe exactly the expected result based on the sample you are providing.

 

Regards,
Tom

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

Hi @TomMartens , thanks for you reply, unfortunately, not exactly what i'm looking for.

I have reproduced my scenario in a pbix file attached in the link below. 
What I would like is to add a calculated column to my 'one' table, with the boolean value of [action] from the 'many' table. I would like this value to be filtered by the latest date of that id (from my date table).
One example would be ItemID: 'abc'. This has both id 1 and 8 linked to it from the date table, ID 8 has the latest date, which means I would like to add: [false] as the value in my 'one' table. 
Hope that makes sense.

Thank you so much!
https://www.dropbox.com/s/7qxw78po0kb43zu/add%20column%20to%20one%20table.pbix?dl=0

 

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.