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
nwheelersons
Frequent Visitor

Top N Customers in Current month compared to their Previous month.

Hi,

 

New to power BI and would like to create a bar chart that shows the top 5 customers for the current month and also these top 5 customers results in previous month so comparisons can be made on how they've changed.

 

Thanks in advance,

 

N

1 ACCEPTED SOLUTION
nwheelersons
Frequent Visitor

managed to complete this, in the end, using by creating a max variable as a filter for weeks 

 

Current Week:

 

test current =

VAR Weeknumber = max('Case Data Collector trending'[Week number])

                RETURN

CALCULATE(sum('Case Data Collector trending'[Case]), 'Case Data Collector trending'[Week number] = Weeknumber)

 

 

View solution in original post

3 REPLIES 3
nwheelersons
Frequent Visitor

managed to complete this, in the end, using by creating a max variable as a filter for weeks 

 

Current Week:

 

test current =

VAR Weeknumber = max('Case Data Collector trending'[Week number])

                RETURN

CALCULATE(sum('Case Data Collector trending'[Case]), 'Case Data Collector trending'[Week number] = Weeknumber)

 

 

v-sihou-msft
Employee
Employee

@nwheelersons

 

Firstly, you need to create a measure to calculate the previous month sales. It can be something like:

 

Previous Month Sales =
CALCULATE ( SUM ( Sales[Sales] ), PREVIOUSMONTH ( Calendar[Date] ) )

Then you can add a TOP N Visual Level Filter based on Sales. 

 

66.PNG

 

Regards,

Thank you for the reply,

 

I used the calculation given but for some reason, it comes up as zero on the graph. so perhaps its to do with the data.

 

my data basically shows the customers name, a reference number, the amount on sale and the date of sale.

 

Cheers

 

Nathan

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.