Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
VizCraft
New Member

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])
)

)

 

VizCraft_0-1752093995134.png

 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

 

2 REPLIES 2
v-ssriganesh
Community Support
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
Community Support
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.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.