Forum Discussion

lmiguez's avatar
lmiguez
Frequent Visitor
8 years ago
Solved

last sales by client

Hi, I hope you can help me. I have a table with number of sale id, sales ammount, date and client. I need to make a table visualization with each client and the last 3 sales to each client. Do you...
  • Zubair_Muhammad's avatar
    8 years ago

    Hi lmiguez

     

    Try adding a RANK calculated column....(RANKING transactions for each CLIENT by date)

    Then you can choose RANK(1,2,3) as your filters

     

    RANK =
    RANKX (
        FILTER ( Table1, Table1[Client] = EARLIER ( Table1[Client] ) ),
        Table1[Date],
        ,
        DESC,
        DENSE
    )
  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    8 years ago

    lmiguez

     

    May be you can use this RANK measure and use it as a VISUAL filter for top3

    Please see attached file as well

     

    RANK Measure =
    RANKX (
        FILTER (
            ALLSELECTED ( Table1 ),
            Table1[Client] = SELECTEDVALUE ( Table1[Client] )
        ),
        CALCULATE ( MAX ( Table1[Date] ) ),
        ,
        DESC,
        DENSE
    )