Forum Discussion
Display nth match
- 4 years ago
Hi Marion ,
In your code, I copy the rank part to a column, you can see there is no rank=2 when SKU="Apple",so it's blank.
Here's my solution.
1.Create a new table.
2.Create relationship of the two tables.
3.Create three measures.
1st = CALCULATE(MAX('Table'[Vendor]),FILTER('Table 2','Table 2'[RANK]=1))2nd = CALCULATE(MAX('Table'[Vendor]),FILTER('Table 2','Table 2'[RANK]=2))3rd = CALCULATE(MAX('Table'[Vendor]),FILTER('Table 2','Table 2'[RANK]=3))I attach my sample bellow to help you to understand.
Best Regards,
Community Support Team_kalyj
If this post helps, then please consider accept it as a solution to help the other members to find it more quickly.
Marion , Try with Dense
2ndVendor Measure =
CALCULATE (
MAXX (
FILTER (
ADDCOLUMNS (
'Table',
"rank",
RANKX (
FILTER ( 'Table', EARLIER ( 'Table'[SKU] ) = 'Table'[SKU] ),
CALCULATE ( MAX ( 'Table'[Date] ) ),
,
DESC, dense
)
),
[rank] = 2
),
[Vendor]
),
ALLEXCEPT ( 'Table', 'Table'[SKU] )
)
Also, order should Asc ?
- Marion4 years agoFrequent Visitor
Hi amitchandak
Thanks for your answer
Dense doesn't change the results.
Ive modified DESC for ASC yes