Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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!
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
105 | |
99 | |
99 | |
38 | |
37 |
User | Count |
---|---|
157 | |
120 | |
74 | |
72 | |
63 |