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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
olives
Helper I
Helper I

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

 

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.