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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
brunodsg
Regular Visitor

Monthly variation by customer

Hi! I have a sales dashboard and I need a table containing a "ranking" with customers with the biggest variations , in quantity of orders and/or sales value (Upsell and downsell), between specific months, for example, between January and March. I already have the general sales variation between one month and the previous one, but I need to specify each customer (out of a total of 300+, most of them are recurring) and also be able to select which months specifically I want to check this variation, but I'm stuck 😖.

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file whether it suits your requirement.

 

Jihwan_Kim_1-1711598873097.png

 

Jihwan_Kim_0-1711598855598.png

 

 

Sales: = 
SUM(sales_fact[sales])

 

 

OFFSET function (DAX) - DAX | Microsoft Learn

 

Sales prev month: = 
CALCULATE (
    SUM ( sales_fact[sales] ),
    OFFSET (
        -1,
        ALL ( calendar_dimension[Year-Month sort], calendar_dimension[Year-Month] ),
        ORDERBY ( calendar_dimension[Year-Month sort], ASC )
    )
)

 

RANK function (DAX) - DAX | Microsoft Learn

 

Diff rank: = 
IF (
    NOT ISBLANK ( [Sales prev month:] ) && NOT ISBLANK ( [Sales:] ),
    RANK (
        SKIP,
        ALL ( customer_dimension[customer] ),
        ORDERBY ( [Sales:] - [Sales prev month:], DESC )
    )
)

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Hi Jihwan_Kim, 
First of all, I would like to thank you so much!
My semantic model is very similar to yours, and your model and DAX worked very well, specially the ranking, but I still need some adjustments:
I want to be able to select witch months (ou even a group) I need to campare, for example:
January 2023 and July 2023
Or a group of months:
Jan + Fev to Mar + Apr
I really don't know how I can make it works.
I'll also include a percentage column, but it's easy.

Hi,

Thank you for your message.

Can you show the slicer that selects the periods based on the users request? It would be great if I can learn more about how your period_comparing_slicer looks like.

Or, please share your sample pbix file's link here, and then I can try to look into it.

Thank you.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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