Show Last N Sales Of A Customer Only Using Power BI


We are going to go through quite an advanced tutorial here utilizing DAX formulas in Power BI

What I want to show you is how we can work out; how many sales we have made from a specific customer….but, we only want to look at the last three sales or last N number of sales rather than all of their sales.

This is where it can get a little more advanced inside of Power BI. Where we have to start utilizing functions which create filtered virtual tables to generate the results we need.

If you think about what we need to do here, we need to work out how to create a filtered table of only the last N number of sales. In this case, three.

In order to do this in a dynamic way inside of our formulas, we need to structure them so that the filtering naturally occurs for every single context that the formula is applied to.

We’re going to cover some great functions here in Power BI that are very useful across a variety of analysis scenarios. These are functions that you should definitely look to get your mind around as soon as you possibly can.

These are functions like SUMX, TOPN, CALCULATE table, and SUMMARIZE.

What I’ve done is I’ve combined all of these functions into one formula. I’ve combined them all to enable us to extract this great insight.

If you can understand how this all works in combination, you’ll be able to generate some seriously amazing insights in your data which are going to add a lot of value.

If you want to learn more about what can be achieved with other techniques just like this one, check out the Business Analytics Series module at Enterprise DNA Online.

Enjoy working through this one.


***** Learning Power BI? *****
FREE COURSE – Ultimate Beginners Guide To Power BI
FREE COURSE – Ultimate Beginners Guide To DAX
FREE – 60 Page DAX Reference Guide Download
FREE – Power BI Resources
Enterprise DNA Membership
Enterprise DNA Online
Enterprise DNA Events

membership banner 3

3 comments on “Show Last N Sales Of A Customer Only Using Power BI”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.