Forum Discussion
Filter Table Based on TOP N and Bottom N
pravkan ,Based on what I got so Far
You can try TOPN
CALCULATE([Total Sales],TOPN([SelectedBottomNValue_RetailerBottom],allselected('BOTTOM N RETAILER TABLE'[BOTTOM N RETAILER]),[Total Sales],DESC),VALUES('BOTTOM N RETAILER TABLE'[BOTTOM N RETAILER]))
use asc for bottom
Hi amitchandak ,
How can I create a measure that will create a RANKX based on retailer name and product subcategory based on the measure you added as comment
CALCULATE([Total Sales],TOPN([SelectedBottomNValue_RetailerBottom],allselected('BOTTOM N RETAILER TABLE'[BOTTOM N RETAILER]),[Total Sales],DESC),VALUES('BOTTOM N RETAILER TABLE'[BOTTOM N RETAILER]))
As I want to select TOP N or BOTTOM N retailer based on retailer name and product sub category.
- amitchandak4 years ago
Super User
pravkan , You can use
CALCULATE([Total Sales],TOPN([SelectedBottomNValue_RetailerBottom],allselected('BOTTOM N RETAILER TABLE'[RETAILER NAME], 'BOTTOM N RETAILER TABLE'[product subcategory NAME]),[Total Sales],DESC),VALUES('BOTTOM N RETAILER TABLE'[BOTTOM N RETAILER]))
To filter we need use summarize of values
Sumx(filter(addcolumns(Summarize('BOTTOM N RETAILER TABLE'
'BOTTOM N RETAILER TABLE'[RETAILER NAME], 'BOTTOM N RETAILER TABLE'[product subcategory NAME]), "_1", [Rank], "_2", [Total Sales] ) , [_1] <= [SelectedBottomNValue_RetailerBottom]) , [_2])
- pravkan4 years agoFrequent Visitor
This is what I want to achieve with Power BII don't know if this possible in dax.
Normally I have all these data stored in a table called V_BOTTOM_SALES