Forum Discussion
Getting value which is second highest date through date relationship table
- Anonymous3 years ago
Hi TotunG ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create two measures.
rank = RANKX(ALLSELECTED('Main Data'),'Main Data'[Date],MAX('Main Data'[Date]),DESC,Dense)second highest date value = CALCULATE(MAX('Main Data'[Value]),FILTER(ALLSELECTED('Main Data'),'Main Data'[rank]=2))(3) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi TotunG ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create two measures.
rank = RANKX(ALLSELECTED('Main Data'),'Main Data'[Date],MAX('Main Data'[Date]),DESC,Dense)second highest date value = CALCULATE(MAX('Main Data'[Value]),FILTER(ALLSELECTED('Main Data'),'Main Data'[rank]=2))
(3) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- TotunG3 years agoResolver I
Thank you for your input, although I think its a bit more complex due to the relationship of the date table that I dont think you cover.
This Sample PBI might explain it better:
https://drive.google.com/file/d/19KDNuA7CRElc-O1H8WwschGNoU29qUBv/view?usp=sharing
- Anonymous3 years agoNot applicable
Hi TotunG ,
The two tables in your pbix file do not have any date columns, please check your pbix file.
Best Regards,
Neeko Tang