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
campelliann
Post Patron
Post Patron

add columns / lookupvalue virtual Table

Hi, 

So I am trying to build a measure which returns the Last PRD Date.

The logic is this, I have a Table "RH projecto" on which I am going to add the Production date for each project "@Data_PRD". The PRD date is on Triskell completo Table, thus the need for the lookupvalue. 
Perhaps I am not building a row context or something like that?

Thanks!

Last PRD Date =
var current_project= SELECTEDVALUE(RH_projecto[ProjectID])
var tabela_virtual= ADDCOLUMNS(All(RH_projecto),"@Data_PRD", LOOKUPVALUE('Triskell Completo'[Produção],'Triskell Completo'[Processo],current_project))
return MAXX(tabela_virtual,[@Data_PRD])
1 ACCEPTED SOLUTION

Hi, first and foremost thank you! I have solved the problem with a calculated column. Using powerbi as excel never fails lol.

The issue seems to be related with the model and some circular dependencies since RH table is a summarized table, this is really a mess by now. Although your tip was good I also tried Calculate(first non blank) with a blank result... But is the syntax of my measure (just for the sake of understanding) correct? In a simpler model would work?

View solution in original post

3 REPLIES 3
tamerj1
Super User
Super User

Hi @campelliann 

can you please share screenshots of the visual. Initially let's say that LOOKUPVALUE returns blank incase it returned multiple rows. If this is your case then you need to summarize theTriskell Completo table to same granularity of the RH_projecto table perhaps using SUMMARIZE to aggregate MAX values of the Completo'[Produção]. If you can share information I might be able to help further. Thank you and have a great day. 

Hi, first and foremost thank you! I have solved the problem with a calculated column. Using powerbi as excel never fails lol.

The issue seems to be related with the model and some circular dependencies since RH table is a summarized table, this is really a mess by now. Although your tip was good I also tried Calculate(first non blank) with a blank result... But is the syntax of my measure (just for the sake of understanding) correct? In a simpler model would work?

Pleaseure to hear that. Yes indeed you need to have clean data and proper relationships before doing DAX. Keepup the good work. Good luck 👍 

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.

Top Solution Authors