Forum Discussion
SteveCampbell
7 years agoMemorable Member
Filter based on rank
For some reason can't work this out I have a table with products 1,2,3,4,5,6 I can filter on any combination I have another table with selected product, based on rank of the product ID I...
- 7 years ago
Hi SteveCampbell,
Can you share a sample and the expected result? Especially the data structure. Please check out the demo in the attachment.
Measure = VAR whichOne = SELECTEDVALUE ( selectedProducts[Selected] ) RETURN MAXX ( FILTER ( SUMMARIZE ( 'Products', Products[ProductName], "ranks", RANKX ( ALLSELECTED ( 'Products' ), CALCULATE ( SUM ( Products[ProductID] ) ), , ASC ) ), [ranks] = whichOne ), [ProductName] )Best Regards,
Dale
SteveCampbell
7 years agoMemorable Member
Measure =
var _selected_invent_spot = min('Inventory Spot'[Inventory Spot])
return
CALCULATE(MAX(inventory[inventory item]),
FILTER(
ADDCOLUMNS(VALUES(inventory[inventory item]),"AAA", RANKX(ALLSELECTED(inventory),inventory[inventory item],,asc) )
,[AAA]=_selected_invent_spot))So my issue was FIRSTNONBLANK
SteveCampbell
7 years agoMemorable Member
Both solutions work, the selected answer is cleaner