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
Akos07
Helper I
Helper I

Inventory turnover

Hello,

 

I have the following problem and i would like to ask for some help.

 

The problem: I would like to calculate AVG Inventory using the following formula. 

 

(Intervallum starting stock / 2) + D2 + D3 + DN + (Intervallum ending stock / 2)
                                       Number of day in the intervallum

D2: Stock in the 2. day of the intervallum
D3: Stock in the 3. day of the intervallum
and so on

With numbers:
Stating stock 1 (2022.07.01)
Day 2 end stock: 2 (2022.07.02)
Day 3 end stock: 4 (2022.07.03)
Intervallum end stock 5 (2022.07.04)

1/2 + 2 + 4 + 5/2
            4

Currently we use sql database and import querry data, but we dont have any table that contain this data so I have to calculate frist the opening and closing stock by each product in BI. I have only data from transaction movements that looks like this.

 

ID - DocumentNumber - Movementtype     - FullfilmentDate - Productid - StoreID - Warehouse - Quantity - NetPrice - GrossPrice 
1 -     DEL01                   -   Delivery income -   2022.07.01      - 34              - 1           - 1                 - 1             - 100         - 127

2 -      S01                      -  Invoice                 -   2020.07.07      -26               - 1           -1                  -2             -  100         -  127

etc

 

I tried to create a view / sql table to store this data but we have around 90.000 diferent porduct 🙂 so its huge.

 

I would relly appreciate anyi help, how to calculate this in BI.

 

Thanks

2 REPLIES 2
amitchandak
Super User
Super User

@Akos07 , Try a measure like

 

new measure =
var _max = maxx(allselected(Date),Date[Date])
var _min = minx(allselected(Date),Date[Date])
return
averageX( values('Date'[Date]), calculate(calculate( sum(Table[Inv Value]), filter('Date', 'Date'[Date] >_min && 'Date'[Date] < _max))+ calculate( sum(Table[Inv Value]), filter('Date', 'Date'[Date] = _min))/2+ calculate( sum(Table[Inv Value]), filter('Date', 'Date'[Date] = _max))/2)
)

Hey,

 

By this Table[Inv Value] you mean how many items do i have in the warehouse at that date, and from that product? If yes how do i calculate that from only the avalible data?

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.