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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Add calculated column to a table (one table) from many.

Hi,
Kind of a weird question. 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.
Have attached a sample pbix file.

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

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

This column expression seems to work in your one table.

LastValue = CALCULATE(LASTNONBLANKVALUE(many[id], FIRSTNONBLANK(many[active], 1)))
 
Pat




Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
mahoneypat
Microsoft Employee
Microsoft Employee

This column expression seems to work in your one table.

LastValue = CALCULATE(LASTNONBLANKVALUE(many[id], FIRSTNONBLANK(many[active], 1)))
 
Pat




Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

worked like a charm! Thanks @mahoneypat !

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors