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 quantity of 397,09

Share bewteen sizes : 

Prozent von Gesamtsumme 2 =
DIVIDE(
    [Total Sales Quantity 2],
    CALCULATE([Total Sales Quantity 2], ALL('Sales 2'[Größe])
)

)

 

 Now  just want to spread the remaining quantity between sizes bei doing so: 

Verteilung = [Restmenge]*[Prozent von Gesamtsumme 2]
Bit it turns out to be in the screenshot, which is not correct, how can I fix this?
 
I'm glad to receive any help.
 
Best,
Cindy

 

  • 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.

4 Replies

  • v-ssriganesh's avatar
    v-ssriganesh
    Community Support

    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.

    • v-ssriganesh's avatar
      v-ssriganesh
      Community Support

      Hello VizCraft,
      I hope the information provided has been useful. Please let me know if you need further clarification or would like to continue the discussion.
      If your question has been answered, please “Accept as Solution” and Give “Kudos” so others with similar issues can easily find the resolution.
      Thank you.

  • v-ssriganesh's avatar
    v-ssriganesh
    Community Support

    Hello VizCraft,
    We hope you're doing well. Could you please confirm whether your issue has been resolved or if you're still facing challenges? Your update will be valuable to the community and may assist others with similar concerns.
    Thank you.

  • v-ssriganesh's avatar
    v-ssriganesh
    Community Support

    Hello VizCraft,

    Hope everything’s going great on your end! Just checking in has the issue been resolved, or are you still running into problems? Sharing an update can really help others facing the same thing.

    Thank you.