Forum Discussion
Get last value from another table
- 4 years ago
Hi, paulorojog ;
You could modify it .
Last client = var _table=SUMMARIZE(FILTER('NSR',EOMONTH([Periodo],0)=EOMONTH(TODAY(),0)),[Numero Profesional]) return IF(NOT( MAX('Dotación'[Nº pers.])) in _table ,BLANK(), CALCULATE(max(NSR[Cliente]),LASTNONBLANK('Calendar'[Date],CALCULATE(max(NSR[Cliente])))))Last project = var _table=SUMMARIZE(FILTER('NSR',EOMONTH([Periodo],0)=EOMONTH(TODAY(),0)),[Numero Profesional]) return IF(NOT( MAX('Dotación'[Nº pers.])) in _table ,BLANK(), CALCULATE(max(NSR[Texto]),LASTNONBLANK('Calendar'[Date],CALCULATE(max(NSR[Texto])))))The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
You should be able to download a sample of the document in this link.
Here you have a reduced sample of the file. There are three tables:
- Dotacion: table of employees
- NSR: table of projects
- Utilization: table of time dedicated to projects per month per employee
As I said, I need to create a summary matrix that for each employee I can see their utilization (that's OK) and the last project and client they were assigned. If in that month, the employee was not assigned to any project, it should appear in blank. The problem is that if I add the project name (text field) and client, the current matrix brings the last ordered by name.
Thank you!
- Ashish_Mathur4 years agoSuper User
Hi,
To know the last project and client they were assigned to is not difficult because you have a Date column in the NSR table - so that can be done. However, in the utilisation table, there is no Date column. So this table would not respond to a Year/Month that we select in a slicer. Therefore, the utilisation figure in your matrix visual will appear incorrect.
FYI, to know the last project and client, you may use the LASTNONBLANK() function.
- paulorojog4 years agoRegular Visitor
Could you be more specific with your proposal? Is your suggestion I use LASTNONBLANK() as a column in a table or as a measure. If it is in a table, which table do you suggest? Employee table? And if it is Employee table, how I call the other table with that function.
Should be the expression LASTNONBLANK('NSR'[Text], Month('NSR'[Date]) = Month(ReportMonth))?
Thank you!
- Ashish_Mathur4 years agoSuper User