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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
alefebvre
New Member

TOP N customers per week

Hello,

I would like to create a chart with the TOP 5 customers who have sent us the most emails per week. I can make a TOP 5 for the last 10 weeks but it takes into account the total number of emails over the 10 weeks and not per week. Would you have a solution to suggest? Thank you for your feedback.

2 REPLIES 2
rajendraongole1
Super User
Super User

Hi @alefebvre -Hope you already create a new calculated column to extract the week number from your date column as below:

calculated column:

 

WeekNumber = WEEKNUM('Emails'[Date], 2) -- 2 means the week starts on Monday

create  measure to calculate the total emails

EmailsPerWeek =
CALCULATE(
COUNT('Emails'[EmailID]),
ALLEXCEPT('Emails', 'Emails'[Customer], 'Emails'[WeekNumber])
)

 

Create another measure to rank customers based on the number of emails

 

CustomerRankPerWeek =
RANKX(
ALL('Emails'[Customer]),
[EmailsPerWeek],
,
DESC,
DENSE
)

 

create anothe measure to filter 

Top5CustomersEmailsPerWeek =
IF(
[CustomerRankPerWeek] <= 5,
[EmailsPerWeek],
BLANK()
)

 

Hope it works ,please check

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hello,

 

Thank you for your solution, I will try to adapt my project with your solution. I will still contextualize my project just in case.

 

OUTLOOK - Top N client table.png

 

As you can see in the image to make my TOP N, I use the following 3 tables:

  • Messages: Email table
  • Date de reception: Calendar table
  • Contacts: Table of sender contacts

As mentioned in my previous post, I manage to get the top 5 per week over the last 30 days but over the entire 30 days (see the image below), which does not correspond to my goal which is to make the top 5 per week over the last 30 days.

 

OUTLOOK - Top N client graphique.png

 

Again, thank you for your feedback.

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.