Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi community,
Let me show the example directly in the picture below...
How can I create a measure to divide 2,119 (E3) by 840 (D4) * 7? (7 days a week)
Under the picture, you can find the measure for stock projection. Really appreciate if anyone can help!
Stock Projection =
CALCULATE(
SUM(Stock[qty]) + SUM(Supply[supply_qty]) - SUM('Demand'[demand_qty]),
ALLSELECTED('Calendar'[Date_]),
ISONORAFTER('Calendar'[Date_], MAX('Calendar'[Date_]), DESC)
)
Solved! Go to Solution.
Hi @cmc910514 ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create a calculated column in Table [Demand].
Index = RANKX('Demand','Demand'[Date],,ASC,Dense)
(3) We can create a measure.
Stock days =
var _a=CALCULATE(MAX('Demand'[Demand]),FILTER(ALLSELECTED('Demand'),'Demand'[Index]=MAX('Demand'[Index])+1))
return DIVIDE([Stock Projection],_a)*7
(4) Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @cmc910514 ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create a calculated column in Table [Demand].
Index = RANKX('Demand','Demand'[Date],,ASC,Dense)
(3) We can create a measure.
Stock days =
var _a=CALCULATE(MAX('Demand'[Demand]),FILTER(ALLSELECTED('Demand'),'Demand'[Index]=MAX('Demand'[Index])+1))
return DIVIDE([Stock Projection],_a)*7
(4) Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 5 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 16 | |
| 8 | |
| 7 | |
| 7 |