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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
yavuzonaran
Frequent Visitor

Production planning practice

Hello,

 

I want to calculate yellow areas in the table could anyone help me?

 

yavuzonaran_0-1720344269798.png

 

7 REPLIES 7
Anonymous
Not applicable

Hi @yavuzonaran ,

 

@foodd , thanks for your concern about this case. I tried to create a sample data myself based on the user's requirement and implemented the result. Please check if there is anything that can be improved. Here is the sample data:

 

vlinhuizhmsft_0-1720405814155.png

 

You can try below formula to create a measure:

Need to buy = SUMX (

    'Table',

    IF (

        'Table'[Amount] > 'Table'[Consumption],

        0,

        'Table'[Consumption] - 'Table'[Amount]

    )

)

 

The final result is shown in the figure:

vlinhuizhmsft_1-1720406083155.png

 

If you have any other questions please feel free to contact me.

 

Best Regards,
Zhu
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

Hello, Any chance to check my last reply? 🙏
Anonymous
Not applicable

Hi @yavuzonaran ,

I apologize for my late reply. Thank you very much for your reply. Following your description, I recreated the two tables that are related:

 

vlinhuizhmsft_0-1721736261000.png

 

vlinhuizhmsft_1-1721736261003.png

 

The relationship between them is:

 

vlinhuizhmsft_2-1721736287966.png

 

Here is my solution:

 

1.Create two measures:

 

 

 

Production Plan = MAX('Table'[Production Plan1])

Consumption = INT(MAX('Table'[Amount])*'Table'[Production Plan])

 

 

 

vlinhuizhmsft_3-1721736348840.png

 

2. You can try below formula to create the measure “need to buy”:

 

 

 

Need to Buy = SUMX('Table (2)',IF('Table (2)'[Amount]<'Table'[Consumption],'Table'[Consumption]-'Table (2)'[Amount],0))

 

 

 

3.The final result is as follows:

 

vlinhuizhmsft_4-1721736348841.png

 

Best Regards,
Zhu
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

 

Hi @Anonymous Thank you very much for your detailed answer appreciate that 🙏 I want to ask you something, In my original workbook, I already have relationship between two tables which are Table 1 [Product Code] and Table 2 [Raw Material Code]. And I cant change this because affecting rest of workbook. If it's possible for you, i would like to show you on an online meeting shortly (max 5 min) and we can reach solution. Hope to hear from you soon 🙏
Anonymous
Not applicable

Hi @yavuzonaran ,

 

Unfortunately I can only offer you help on the community. But according to your description, I made changes to the model relationships I created and now I have the situation as shown in the picture:

 

vlinhuizhmsft_0-1721978183664.png

 

vlinhuizhmsft_1-1721978183671.png

Is this a problem that you are experiencing? I would be grateful if you could provide me with the pbix file or sample data. Remember to remove sensitive data and do not log in to your account in Power BI Desktop when uploading the pbix file.

 

Best Regards,
Zhu
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

Hello @Anonymous Thank you for your reply. There is a relationship between first table's first column and second table's first column and icant break it because it affects rest of document. So, is there any other solution for this?

Thanks in advance 🙏🙏

foodd
Super User
Super User

Hello @yavuzonaran , remember to adhere to the decorum of the Community Forum when asking a question.

Please provide your work-in-progress Power BI Desktop file (with sensitive information removed) that covers your issue or question completely in a usable format (not as a screenshot).

https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

This allows members of the Forum to assess the state of the model, report layer, relationships, and any DAX applied.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

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.