Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

New table aggregate Items sales per last 12 Month

Hi I have following table with Items sale per month e year per row.

Each items has more record


Item_NoSomma di Sales_Entry_NoSales_Post_DateSomma di Sold_QuantityMonthYear
T- Shirt 32814910/06/2021 00:000Giugno2021
T- Shirt 32823716/06/2021 00:0025Giugno2021
T- Shirt 323087528/06/2022 00:000Giugno2022
T- Shirt 323097030/06/2022 00:0025Giugno2022
Jacket 211652704/05/2021 00:000Maggio2021
Jacket 211652805/05/2021 00:00400Maggio2021
Jacket 2113423913/12/2021 00:00200Dicembre2021
Jacket 2115168815/12/2021 00:000Dicembre2021
Jacket 2113893905/01/2022 00:00600Gennaio2022
Jacket 2114976117/02/2022 00:00400Febbraio2022
Jacket 2118300920/04/2022 00:00500Aprile2022
Jacket 2117166505/12/2022 00:00500Dicembre2022
Jacket 21114466415/12/2022 00:001200Dicembre2022
Jacket 2117540406/02/2023 00:00800Febbraio2023
Socket1473405/03/2021 00:00200Marzo2021
Socket3783016/07/2021 00:0050Luglio2021
Socket1932719/07/2021 00:000Luglio2021
Socket1941520/07/2021 00:00200Luglio2021
Socket6056225/10/2021 00:00200Ottobre2021
Socket11633411/05/2022 00:00250Maggio2022
Socket7209912/12/2022 00:00200Dicembre2022

I would like to create a new table with aggred Item per sale last 12 month 

for instance

Item_NoSold_Quantity 12 month
T- Shirt 3235456
Jacket 211232456
Super User
Super User

@fabiopaturzo , better to create a measure with help from date table



Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-12,MONTH))


window function you can also use

Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD:

!! Microsoft Fabric !!
Microsoft Power BI Learning Resources, 2023 !!
Learn Power BI - Full Course with Dec-2022, with Window, Index, Offset, 100+ Topics !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!

I would like to have the total sales per Item

Helpful resources

May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Submit your Data Story

Data Stories Gallery

Share your Data Story with the Community in the Data Stories Gallery.

Top Solution Authors