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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
pbi_newuser2023
Frequent Visitor

Top 10 customer and its respective M-1 and M-2 data

Hi, how to show the Top 10 clients with sales of current month, previous month and last 2 months? For example, when April is selected on the Month slicer, the table shows top 10 clients based on sales amount in April. The table also shows the sales amount for previous month and past 2 months for the current top 10 clients. 

 

pbi_newuser2023_0-1685087911494.png

Here is the sample data.

Top 10 Client Sales Amount Month
A                     32April
B                     57April
D                     85April
E                     96April
F                     93April
G                     84April
H                     53April
I                       6April
J                     80April
K                     41April
A                     88March
B                     41March
D                     71March
E                     89March
F                     72March
G                     65March
H                     93March
I                     38March
J                     40March
K                     41March
A                     51February
B                     13February
D                     70February
E                     62February
F                     28February
G                     52February
H                     67February
I                       3February
J                     70February
K                     16February

 

1 ACCEPTED SOLUTION

3M.pbix

 

ThxAlot_0-1685166913833.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



View solution in original post

4 REPLIES 4
ThxAlot
Super User
Super User

The question itself is easy enough; but I'd not bother to spend more time making mock-up data than authoring the solution. Paste some copiable mock-up data.



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



Hi @ThxAlot , I have added the sample data in my post now. Thanks.

3M.pbix

 

ThxAlot_0-1685166913833.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



Hi @ThxAlot , thank you for the solution! It works. How about bottom 10? Can you show me how to do it? Thanks a lot! 🙂

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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