cancel
Showing results for
Did you mean:
Frequent Visitor

## Create a table using latest available value

Hello everyone! I have two tables one is factual and the other is dimensional and I need to create a relationship based on the "Dojo" where the employees worked. In this scenario My dimension (Latest worked dates) table will not filter the factual (worked dates) table, on the contrary, I need to look up some values from the factual (worked dates) table.  See example below.

One of the solution I come up for this is creating a bridge table, either by dax or query formula, but I have not been able to solve it yet.

Please help me providing solutions on how to create an additional table that turns my dimension table  into a factual table that contains only the latest value found.

One of the tables is a factual table (working days), that refreshes every week, therefore It may update  employee working dojo / attributes  from one week another like this

 Employee ID Dojo Worked Working Date 1122 Mcdojo 29-Jan-23 2233 Mcdojo 29-Jan-23 1122 DojoElite 5-Feb-23 2233 Mcdojo 5-Feb-23 1122 Mcppato 12-Feb-23

On the other table, I have a factual table including only one entry for each employee that contains the last date they worked.

 Employee ID Last Date Worked Last Dojo Worked 1122 6-Feb-23 ?

Desired Factual Table

 Employee ID Latest Dojo Worked Latest Date Available 2233 Mcdojo 5-Feb-23 1122 Mcppato 12-Feb-23
2 ACCEPTED SOLUTIONS
Solution Sage

Hope this helps:  However, in your data

 Employee ID Latest Dojo Worked Latest Date Available 2233 Mcdojo 29-Jan-23 ------> this is incorrect the latest is 5-Feb-23 1122 Mcppato 12-Feb-23

Solution Sage

Instead of MAX(), you may use MIN()

3 REPLIES 3
Solution Sage

Hope this helps:  However, in your data

 Employee ID Latest Dojo Worked Latest Date Available 2233 Mcdojo 29-Jan-23 ------> this is incorrect the latest is 5-Feb-23 1122 Mcppato 12-Feb-23

Frequent Visitor

It worked 😄 thanks, how would I do the Opposite? Creating the table with the earliset result found for each employee based on date?

Solution Sage

Instead of MAX(), you may use MIN()

Announcements

#### Power BI T-Shirt Design Challenge 2023

Submit your creative T-shirt design ideas starting March 7 through March 21, 2023.

#### Power BI March 2023 Update

Find out more about the March 2023 update.

#### March 2023 Events

Find out more about the online and in person events happening in March!

Top Solution Authors
Top Kudoed Authors