March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi All,
I am trying to do Excess Stock analysis in Power BI but can't get this work.
Please see below for example and Result:
DEMAND DATA:
STOCK DATA:
RESULT:
Thanks in advance if you can help to achieve above result.
Solved! Go to Solution.
Hi @mb0307 ,
"Total Available Stock Meeting Demand" = CALCULATE(SUM(STOCK[Stock]),FILTER(ALL(STOCK),STOCK[Available Date].[Month]=SELECTEDVALUE(DEMAND[Date of Demand].[Month])&&STOCK[Available Date]>=SELECTEDVALUE(DEMAND[Date of Demand])))
Stock NOT Meeting Demand = CALCULATE(SUM(STOCK[Stock]),FILTER(ALL(STOCK),STOCK[Available Date].[Month]=SELECTEDVALUE(DEMAND[Date of Demand].[Month])&&STOCK[Available Date]<SELECTEDVALUE(DEMAND[Date of Demand])))
Excess Stock = [Stock NOT Meeting Demand]-SUM(DEMAND[Demand])
Best Regards,
Jay
Hi @mb0307 ,
"Total Available Stock Meeting Demand" = CALCULATE(SUM(STOCK[Stock]),FILTER(ALL(STOCK),STOCK[Available Date].[Month]=SELECTEDVALUE(DEMAND[Date of Demand].[Month])&&STOCK[Available Date]>=SELECTEDVALUE(DEMAND[Date of Demand])))
Stock NOT Meeting Demand = CALCULATE(SUM(STOCK[Stock]),FILTER(ALL(STOCK),STOCK[Available Date].[Month]=SELECTEDVALUE(DEMAND[Date of Demand].[Month])&&STOCK[Available Date]<SELECTEDVALUE(DEMAND[Date of Demand])))
Excess Stock = [Stock NOT Meeting Demand]-SUM(DEMAND[Demand])
Best Regards,
Jay
Can we see your data ?
if you have this 2 tables you need to merge your tables on product and month/year
See this I create the query, I need more information about business rules to create total's
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
115 | |
77 | |
58 | |
52 | |
45 |
User | Count |
---|---|
167 | |
117 | |
63 | |
57 | |
50 |