Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
lmiguez
Frequent Visitor

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 know how can I do this?

Thank you very much.

Best regards,

Lucía

2 ACCEPTED SOLUTIONS
Zubair_Muhammad
Community Champion
Community Champion

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
)

Regards
Zubair

Please try my custom visuals

View solution in original post

@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
)

Regards
Zubair

Please try my custom visuals

View solution in original post

4 REPLIES 4
Zubair_Muhammad
Community Champion
Community Champion

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
)

Regards
Zubair

Please try my custom visuals

Hi @Zubair_Muhammad

 

Thanks for your reply. It works perfectly but I need to do this through a measure because I need to interact with date slicer.

Do you know how can I do that?

 

Best regards,

Lucía

@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
)

Regards
Zubair

Please try my custom visuals

@Zubair_Muhammad Thak you very much!

Best regards,

Lucía

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.