Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get 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.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 6 | |
| 6 | |
| 5 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 15 | |
| 13 | |
| 13 |