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 for a selected period

Hi! I am trying to cummulate my sales from the most sold to the least sold product for a selected period having a data Table with this structure: --> Date, Product, Sales

 
If the table did not contain Date, this measure would work properly:

 

Cummulative_sales = CALCULATE(sum(table[sales]), FILTER(all(table),table[sales]>=MAX(table[sales])))
 
However I need to build up a table with product and cummulative sales (from the most sold product to the least sold product) filtering by a period date, so I tried:
 
Cummulative_sales = CALCULATE(sum(table[sales]), FILTER(
ALLEXCEPT(table, table[date]), table[sales]>=MAX(table[sales])))
 
But table is not cummulating data 😥
2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @alexrf86 ,

 

Can you show some sample data and expected result to us?

 

Best Regards,

Jay

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Hi @v-jayw-msft ! Thanks for your answer.

 

My database contains a table with the following data:

 

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/2020a13
03/01/2020b54

I want to build up a table with Product and cummulative Sales from most sold product to least sold product and using date as a filter. For instance, selecting a date filter period from 01/01/2020 to 02/01/2020 my product sales would be:

 

k24
b513
a16

 

So the desire result is:

 

b513
a119
k223

 

I used to cummulate sales without date dimension, so this measure used to work:

 

Cummulative_venta_neta = CALCULATE(SUM(table[sales]),
                                                                  FILTER(ALL(table),table[sales]>=MAX(table[sales]))).
 
However when I entered the date dimension in Table Data, measure is not cummulating and date filter is not working either.
 
May you please help me?
 
Thanks

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.