Forum Discussion
Inventory Forecast Isuue
- Anonymous2 years ago
Hi Anonymous ,
Please see the attachment for details.
Best Regards,
Wenbin Zhou
Hi Anonymous ,
The Table data is shown below:
Please follow these steps:
1.Add index column after grouping
Table.AddIndexColumn([Column],"Index",1)
2.Use the following DAX expression to create a measure
Balance =
VAR _Product_Code =
SELECTEDVALUE ( 'Table'[Product Code] )
VAR _Month =
SELECTEDVALUE ( 'Table'[Month] )
VAR _table =
SUMMARIZE (
ALL ( 'Table' ),
[Product Code],
[Month],
"Index", MAX ( 'Table'[Index] ),
"Column",
SUM ( 'Table'[Inventory] ) + SUM ( 'Table'[PO] )
+ SUM ( 'Table'[SC] )
- SUM ( 'Table'[SO] )
- SUM ( 'Table'[BOM] )
)
VAR _table2 =
ADDCOLUMNS (
_table,
"Column2",
MAXX (
FILTER (
_table,
[Product Code] = EARLIER ( [Product Code] )
&& [Index]
= EARLIER ( [Index] ) - 1
),
[Column]
)
)
RETURN
MAXX (
FILTER ( _table2, [Product Code] = _Product_Code && [Month] = _Month ),
[Column] + [Column2]
)
3.Final output
Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
Thank you for Solution.
but i dont have the combined data.
every table is different and what you have suggested in first image is combined.
- Anonymous2 years agoNot applicable
Hi Anonymous ,
Do you mean that the data is stored in 7 different tables? Can you share simple data or .pbix files without sensitive data?
How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Best Regards,
Wenbin Zhou- Anonymous2 years agoNot applicable
Yes. Plase find the below link to excel file.
where I have calculated the expected result in excel. but i want to do it same in Bi.
https://docs.google.com/spreadsheets/d/1RCBxYYn91yScKWCEDVfI0mQILqUME2lE/edit?gid=1879817136#gid=1879817136- Anonymous2 years agoNot applicable
Hi Anonymous ,
When I clicked the link, it said I don't have permission.
Best Regards,
Wenbin Zhou