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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Calculate cycle of order from the last 12 months from the last sales

Hi,

I am trying to create a calculated column to show the cycle of order (number of months) that two products (A and B) are ordered in each store.

I have a "Store" table, "Sales" table and "Calender" table.

I would like to start calculating from the last 12 months from the last sale.

 

sales

store_cdQTYdateitem
20012021/10/1C
20052021/11/1A
20032021/12/1A
20052022/2/1C
200112022/5/1A
20022022/7/1B
20022022/10/1A
20022022/10/1C
20032022/11/1A
20062022/12/1A
200-62022/12/1A

 

stores

store_cdstore_name
200StoreA
201StoreB
202StoreC
203

StoreD



For the result, I would like to get 2.4 (12month /5 times) for store 200.

olives_1-1677751989286.png

 

Please help!

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

2 REPLIES 2
lbendlin
Super User
Super User

lbendlin_0-1677895892344.png

 

Anonymous
Not applicable

@lbendlin 
Thank you so much for your help!
It worked😊

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.