Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register 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!
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
88 | |
86 | |
82 | |
66 | |
49 |
User | Count |
---|---|
138 | |
110 | |
104 | |
66 | |
64 |