Forum Discussion
Understanding variable calculation
- 10 months ago
Variables are calculated once per row context in SUMX, not once per entire measure. Your issue is that [m_fcst_qty_erp] is being evaluated outside the row context.
Fix it by moving the variable inside SUMX:
usage dynamic =
SUMX(
fact_bom,
VAR _base = [m_fcst_qty_erp]
RETURN
fact_bom[TotalQty] * _base
)
Variables are calculated once per row context in SUMX, not once per entire measure. Your issue is that [m_fcst_qty_erp] is being evaluated outside the row context.
Fix it by moving the variable inside SUMX:
usage dynamic =
SUMX(
fact_bom,
VAR _base = [m_fcst_qty_erp]
RETURN
fact_bom[TotalQty] * _base
)
- v-menakakota10 months agoCommunity Support
Hi Hansolu ,
Thanks for reaching out to the Microsoft fabric community forum.I would also take a moment to thank Kedar_Pande , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.
I hope the below details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you
Best Regards,
Community Support Team- v-menakakota10 months agoCommunity Support
Hi Hansolu ,
I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you.
Best Regards,
Community Support Team- v-menakakota9 months agoCommunity Support
Hi @Hansolu ,
I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you.
Best Regards,
Community Support Team