cancel
Showing results for 
Search instead for 
Did you mean: 
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
Solution Sage
Solution Sage

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
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Top Solution Authors