Forum Discussion
SteveCampbell
Memorable Member
7 years agoFilter 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
Memorable Member
7 years agoMeasure =
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
v-jiascu-msft
Microsoft Employee
7 years agoHi 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