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
Portrek
Resolver III
Resolver III

Find the last date in a table and show a relative column in another table.

Hello everybody, I have a problem.

 

I have two tables, the first is updated every month sequencelly like the image below and show the situation for employees.

 

Sem título78.png

 

The second table is fixed, and stores employee datas. like the secound image.

 

Sem título98.png

 

I need the "Situation" field (blue) to always be updated with the last value put in the first table. (red mark). in this case the result has been - remote / remote / sick / ok

 

How can i do that. Any help is greatly appreciated.

 

Thanks in advanced.

1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@Portrek 

I agree that a calculate column should do.

Column = CALCULATE(MAX('Table'[Situation]),LASTDATE('Table'[Date]))
V-pazhen-msft_0-1621387480897.png

 

 


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
V-pazhen-msft
Community Support
Community Support

@Portrek 

I agree that a calculate column should do.

Column = CALCULATE(MAX('Table'[Situation]),LASTDATE('Table'[Date]))
V-pazhen-msft_0-1621387480897.png

 

 


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

Jihwan_Kim
Super User
Super User

Hi, @Portrek 

Please check the below.

I created a sample pbix file based on the explanation.

If you have relationships with different table, then it the measure might need to be amended.

Based on the information that is provided, the below works fine.

 

Picture3.png

 

https://www.dropbox.com/s/t8m7m00dtccmjy3/portrek.pbix?dl=0 

Situation Measure =
IF (
ISFILTERED ( 'Table'[ID number] ),
LASTNONBLANKVALUE ( 'Table'[Date], SELECTEDVALUE ( 'Table'[Situation] ) )
)

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Hello, Jihwan_Kim.

 

Thank you for your help, but unfortunately it did not work for me, Mesure could not return the values.

 

Basically, I have two tables in my PBI, the first has the information of the employees, such as names, age, address, identification, etc. And at the second table I have information on the situation of these employees as removed, sick, licensed, retirees, etc.

 

The first table is fixed, is only updated when a new employee is hired. The second table is updated monthly with the current situation of the employee. So I intend to show among my data the total number of employees and the current quantitative according to the situation of the moment.

 

So I have to tell the PBI to locate the latest date in Table 2, compare the records (ID) and return the value of the collune situation. Something like a lookupvalue considering the last date of the calendar column.

 

I think a calculated column that brought me; Latest information from the column situation of Table 2 would solve my problem, but I still have not found a way to build this ..

 

A common key between the tables are the identification numbers.

 

Anyway, thank you for the support.

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.