Forum Discussion

bantoszewski's avatar
bantoszewski
Frequent Visitor
1 year ago
Solved

custom sorting in a matrix table

Hi,   I have the following table: Product Month Sales Volume A 1 50 40 A 2 60 30 A 3 40 20 B 1 40 30 B 2 30 20   which I would like to show in matrix with ...
  • SamWiseOwl's avatar
    SamWiseOwl
    1 year ago

    Hi bantoszewski 
    You can use calculate on your measure to remove the Month filter to rank the products

    Rank measure =
    RANKX(
        ALLSELECTED('Test Table'[Product])
        ,CALCULATE([SalesAm],ALLSELECTED('Test Table'[Month]))
        ,
        ,DESC
        ,Skip
    )
     
    If the year/month are from a seperate calendar table you could do AllSelected(CalendarTable) or if they are from the sale Date column use AllSelected(table[date]). If the same table different columns AllSelected(table[month],table[year]).