March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I have two tables:
Simple visualization:
Table_1 and Table_2 are related, many-to-many via a bridging table (distinct on ID). I can't seem to find the right set of functions to get me the value I want. Any help greatly appreciated!
Thanks in advance.
Solved! Go to Solution.
Hey,
I'm using the following DAX statement to create a calculated column in Table_2, maybe this is already sufficient and it's not necessary to create a Table_3:
Last Revision Number = var thisID = 'Table_2'[ID] var thisDate = 'Table_2'[Date] return MAXX( TOPN( 1 ,FILTER( ALL('Table_1') ,'Table_1'[ID] = thisID && 'Table_1'[Changed_Date] <= thisDate ) ,'Table_1'[Changed_Date] ,DESC ) ,[Revision Number] )
Please be aware that I'm using <= instead of just < because there is no revision number before 2018-11-01.
Regards,
Tom
Hi @Aidan,
By my tests, the solution of TomMartens should be helpful.
If you have solved your problem, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.
If you still need help, please feel free to ask.
Best Regards,
Cherry
Hey,
I'm using the following DAX statement to create a calculated column in Table_2, maybe this is already sufficient and it's not necessary to create a Table_3:
Last Revision Number = var thisID = 'Table_2'[ID] var thisDate = 'Table_2'[Date] return MAXX( TOPN( 1 ,FILTER( ALL('Table_1') ,'Table_1'[ID] = thisID && 'Table_1'[Changed_Date] <= thisDate ) ,'Table_1'[Changed_Date] ,DESC ) ,[Revision Number] )
Please be aware that I'm using <= instead of just < because there is no revision number before 2018-11-01.
Regards,
Tom
That's brilliant. Thanks very much!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
85 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |