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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
3005mfab
Frequent Visitor

Dashboard of the future development of the inventory

Hello everyone,

 

I need help creating a dashboard in Power BI that forecasts future inventory based on my current daily inventory. I have the following tables available:

Daily Inventory table (current inventory) with the columns:

Material
Material Description
Date Added
Total Value
Total Value in EUR
SLoc

EKPO table (purchase orders), which increase the stock, with the columns:

Pur. Doc.
Item
Material
PO Quantity
Plnt
Deliv. Date
Scheduled Qty

RESB table (requirements) that reduce the stock, with the columns:

Material
Plant
Storage Location
Requirements date
Requirement Quantity

AFPO table (production orders) that increase the stock, with the columns:

Order
Material Number
Planned order qty
Basic finish date

 

What is the best way to join these tables and create corresponding measures? Are there any recommendations for DAX formulas or visualizations that are particularly helpful here?

Thank you in advance for your support!

1 ACCEPTED SOLUTION

Thanks for NaveenGandhi's concern about this case.

Hi @3005mfab ,


I added to the data you gave me and implemented a July-based inventory forecast. It's possible that the data I've created and the metrics will deviate from what you have, and you can take my ideas and optimise them. Here is my solution:


1.Create simple data, the specific data and relationships you can see in the .pbix file I gave you.

 

 vlinhuizhmsft_0-1723463448524.png

 

In the meantime, on the basis of the data you have given, I have also created a table of dates from 7.1 to 10.1, which I will project for August and September.

 

 vlinhuizhmsft_1-1723463484307.png

 

2.Create a measure:

 

Inventory =
VAR _sum =
    SUM ( 'Daily Inventory'[Total Value] )
VAR _else =
    SUM ( 'AFPO'[Planned order qty] ) + SUM ( 'EKPO'[Scheduled Qty] )
        - SUM ( 'RESB'[Requirement Quantity] )
VAR _forecast_aug =
    CALCULATE (
        SUM ( 'Daily Inventory'[Total Value] ),
        DATEADD ( 'Date'[Column1], -1, MONTH )
    )
VAR _forecast_sep =
    CALCULATE (
        SUM ( 'Daily Inventory'[Total Value] ),
        DATEADD ( 'Date'[Column1], -2, MONTH )
    )
RETURN
    SWITCH (
        TRUE (),
        MAX ( 'Date'[Column1] ) > DATE ( 2024, 8, 1 )
            && MAX ( 'Date'[Column1] ) < DATE ( 2024, 9, 1 ), _forecast_aug + _else,
        MAX ( 'Date'[Column1] ) >= DATE ( 2024, 9, 1 )
            && MAX ( 'Date'[Column1] ) < DATE ( 2024, 10, 1 ), _forecast_sep + _else,
        MAX ( 'Date'[Column1] ) <= DATE ( 2024, 8, 1 ), _sum
    )

 

Using July's inventory to forecast August and September's, plus additional increases and decreases, a forecast can be achieved.

 

3.The final reslut is as follows:

 

 vlinhuizhmsft_2-1723464034343.png

Best Regards,
Zhu
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

View solution in original post

4 REPLIES 4
3005mfab
Frequent Visitor

  1. Daily Inventory Table (current inventory) with the columns:

    Material Material Description Date Added Total Value Total Value in EUR SLoc Identifier
    123456Bolt M10x50 ST 10.9 ZPTuesday, August 1, 20242018.75600123456600
  2. EKPO Table (purchase orders) that will increase the inventory, with the columns:

    Pur. Doc. Item Material PO Quantity Plnt Deliv. Date Scheduled Qty
    9054321000020987654310.000241008/25/202410.000
  3. RESB Table (requirements) that will decrease the inventory, with the columns:

    Material Plant Storage Location Requirements date Requirement Quantity
    34567892410060009/01/20242
  4. AFPO Table (production orders) that will increase the inventory, with the columns:

    Order Material Number Planned order qty Basic finish date
    675839209876543509/10/2024

Additionally, the stock values are in the MBEW Table, which looks like this:

Material Valuation Area Valuation Type Del. flag val. type Total Stock Total Value Price control Moving price

00001022311 0.0000.0000.00V0.01

Based on these tables, I would like to create a line chart where the x-axis represents the date and the y-axis represents the expected inventory.

Thanks for NaveenGandhi's concern about this case.

Hi @3005mfab ,


I added to the data you gave me and implemented a July-based inventory forecast. It's possible that the data I've created and the metrics will deviate from what you have, and you can take my ideas and optimise them. Here is my solution:


1.Create simple data, the specific data and relationships you can see in the .pbix file I gave you.

 

 vlinhuizhmsft_0-1723463448524.png

 

In the meantime, on the basis of the data you have given, I have also created a table of dates from 7.1 to 10.1, which I will project for August and September.

 

 vlinhuizhmsft_1-1723463484307.png

 

2.Create a measure:

 

Inventory =
VAR _sum =
    SUM ( 'Daily Inventory'[Total Value] )
VAR _else =
    SUM ( 'AFPO'[Planned order qty] ) + SUM ( 'EKPO'[Scheduled Qty] )
        - SUM ( 'RESB'[Requirement Quantity] )
VAR _forecast_aug =
    CALCULATE (
        SUM ( 'Daily Inventory'[Total Value] ),
        DATEADD ( 'Date'[Column1], -1, MONTH )
    )
VAR _forecast_sep =
    CALCULATE (
        SUM ( 'Daily Inventory'[Total Value] ),
        DATEADD ( 'Date'[Column1], -2, MONTH )
    )
RETURN
    SWITCH (
        TRUE (),
        MAX ( 'Date'[Column1] ) > DATE ( 2024, 8, 1 )
            && MAX ( 'Date'[Column1] ) < DATE ( 2024, 9, 1 ), _forecast_aug + _else,
        MAX ( 'Date'[Column1] ) >= DATE ( 2024, 9, 1 )
            && MAX ( 'Date'[Column1] ) < DATE ( 2024, 10, 1 ), _forecast_sep + _else,
        MAX ( 'Date'[Column1] ) <= DATE ( 2024, 8, 1 ), _sum
    )

 

Using July's inventory to forecast August and September's, plus additional increases and decreases, a forecast can be achieved.

 

3.The final reslut is as follows:

 

 vlinhuizhmsft_2-1723464034343.png

Best Regards,
Zhu
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

Hi Zhu @v-linhuizh-msft , 

 

Thank you very much for your help so far! Since I wanted to know the value in EUR, I tried to adjust the measure.

Inventory =
var _sum=SUM('DailyInventory_line (2)'[Total Value in EUR])
VAR _else=SUM('AFPO'[Value])+SUM('EKPO'[Value])-SUM('RESB'[Value])
var _forecast_aug=CALCULATE(SUM('DailyInventory_line (2)'[Total Value in EUR]),DATEADD('Date'[Date],-1,MONTH))RETURN
SWITCH(TRUE(),
MAX('Date'[Date])>DATE(2024,8,1)&&MAX('Date'[Date])<DATE(2024,9,1),_forecast_aug+_else,
MAX('Date'[Date])<=DATE(2024,8,1),_sum)

 

What I get now is the following graph. The numbers are now correct when you consider the addition of AFPO, EKPO and RESB. Do you have any idea why it shows me, for example, -0.10M instead of 17.6M (17.7-0.10M = 17.6M)? Could you give me some more help as to what could be the reason for this? please find attached a screenshot.

3005mfab_1-1723562906952.png

 

NaveenGandhi
Super User
Super User

Hi @3005mfab 

Please post sample data, expected output along with screenshots to understand the problem better.

Regards,

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

August Carousel

Fabric Community Update - August 2024

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