Forum Discussion
top N customer based on filter
- 10 years ago
If you have a table like below, you can first create a Calendar table and create relationship between transactional table and Calendar table with Date key.
Calendar = CALENDAR ( "1/1/2016", "12/31/2016" )
Then create two Columns in the Calendar table for the Month and Quarter slicer.
Month = MONTH ( 'Calendar'[Date] )
Quarter = ROUNDUP ( MONTH ( [Date] ) / 3, 0 )
Create a measure to rank the customer according to selection in the Month and Quarter slicer.
Rank = RANKX ( ALL ( Table1[Customer] ), CALCULATE ( SUM ( Table1[Sales] ) ) )
I’ve also uploaded my .pbix file here for reference.
Best Regards,
Herbert
If you have a table like below, you can first create a Calendar table and create relationship between transactional table and Calendar table with Date key.
Calendar = CALENDAR ( "1/1/2016", "12/31/2016" )
Then create two Columns in the Calendar table for the Month and Quarter slicer.
Month = MONTH ( 'Calendar'[Date] )
Quarter = ROUNDUP ( MONTH ( [Date] ) / 3, 0 )
Create a measure to rank the customer according to selection in the Month and Quarter slicer.
Rank = RANKX ( ALL ( Table1[Customer] ), CALCULATE ( SUM ( Table1[Sales] ) ) )
I’ve also uploaded my .pbix file here for reference.
Best Regards,
Herbert