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.
Hello,
i've got some issues with adding latest value from one table to another, maybe someone could help me. So.. I've created new calculated table that stores distinct UNIQUE ID values from two other tables (1 table on attached screen). In third table (2 table) i have unique id's, some values, dates and calculated column, that calculates lates value by date for that ID. Now i need to add that calculated latest value from 2 table to a 1 table. Relations betweens this tables looks like 1 to * and that's the issue - the formula does not know which value to transfer from 2 table to 1 table. How can i solve that? Any suggestions?
Solved! Go to Solution.
You won't believe... because latest value for same ID is always the same, even if that ID appears two or more times, simple lookupvalue function solves me everything.
You won't believe... because latest value for same ID is always the same, even if that ID appears two or more times, simple lookupvalue function solves me everything.
Hi @Daniel_Fdrvc ,
Please try the following formula:
Latest value =
VAR latestDate =
CALCULATE (
MAX ( 'Table 2'[Date] ),
FILTER ( 'Table 2', 'Table 2'[ID] = 'Table 1'[Unique ID] )
)
VAR latestValue =
MAXX (
FILTER (
'Table 2',
'Table 2'[ID] = 'Table 1'[Unique ID]
&& 'Table 2'[Date] = latestDate
),
'Table 2'[Value]
)
RETURN
latestValue
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Daniel_Fdrvc Perhaps:
Latest value column =
VAR __Rows = SELECTCOLUMNS('Table2',"__LatestValues",[Latest value])
RETURN
IF("no" IN __Rows,"no","yes")
@Greg_Deckler this add's to all unique id's in 1 table same value, for example - yes 😞
@Daniel_Fdrvc I assumed the tables were related to one another, try:
Latest value column =
VAR __ID = [Unique ID]
VAR __Rows = SELECTCOLUMNS(FILTER('Table2',[ID] = __ID),"__LatestValues",[Latest value])
RETURN
IF("no" IN __Rows,"no","yes")
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
142 | |
108 | |
101 | |
81 | |
74 |