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
alexrf86
Helper III
Helper III

Cummulative sales from most sold to least sold product filtering by a selected period

Hi! I am trying to acummulate my sales from the most sold to the least sold product for a specific selected period. Data Table has this structure: --> Date, Product, Sales.

 

For instance,

 

DateProdSales
01/01/2020  k23
01/01/2020  a14
01/01/2020  b510
02/01/2020  k21
02/01/2020  a12
02/01/2020  b53
03/01/2020  k22
03/01/2020  a13
03/01/2020  b54
04/01/2020  b51
04/01/2020  a11
 
So, If my desired result was the acummulative sales from the most sold product to the least sold product for the period 02/01/2020 to 03/01/2020, I should get this table:
 
b57
a112
k215
 
This is because product sales during this period have been:
 
k23
b57
a15

 

So if I ordered sales products from most sold to least sold:

 

b57
a15
k23

 

Finally, product cummulating sales:

 

b57
a112
k215

 

If the Data Table did not contain Date, this measure would cummalate sales properly from most sold to least sold:

 

Cummulative_sales = CALCULATE(sum(table[sales]), FILTER(all(table),table[sales]>=MAX(table[sales])))
 
However I need to include Date in Data Table to be able to filter the period I need to acummulate sales.
 
May anyone help me please?
2 REPLIES 2
amitchandak
Super User
Super User

@alexrf86 , I doubt you can get this order.

Please check quick measure  there is an option for running/cumulative total try that

@amitchandak  Order is not a problem. I can add a column with the total Sales per product and use this column to order. For example:

          

Product    Period Sales     Cummulate Sales
b5   7   7
a1   5   12
k2   3   15

 

My issue is how to create a Cummulate Sales measure choosing a specific date period (not from the beginning of my calendar)

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.