Forum Discussion

VizCraft's avatar
VizCraft
New Member
1 year ago
Solved

how to write measure correctly

Hi guys, it's my first time here. Is the community in englisch only? ok, I have a problem with DAX I have MOQ of 1000 pcs I have a total forecast quatitiy per Artcle-Color 602,91 Remaining quant...
  • v-ssriganesh's avatar
    1 year ago

    Hello VizCraft,
    Thanks for posting your query and welcome to the Microsoft Fabric Community.

    I’ve reviewed your scenario in detail and reproduced it in Power BI. Your goal was to distribute the remaining quantity (Restmenge) based on each size’s share of the total forecast, and the logic works as expected using the correct DAX measures.

    What I Did:

    • Recreated your sample data (Article Size + Forecast Quantity).
    • Calculated:
      • Total Forecast Quantity
      • Restmenge = MOQ - Total Forecast
      • Prozent von Gesamtsumme using proper context removal
      • Verteilung as the proportional share of remaining quantity
    • Used DAX context correction to ensure accurate row-level allocation.

    The key fix was adjusting the DAX to ensure that both [Restmenge] and the percentage calculation were not affected by row filters. For your reference, I’ve attached a .pbix file please feel free to download and explore the file.


    If this information is helpful, please “Accept as solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
    Thank you.