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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
EstêvãoNogueira
Regular Visitor

How to get a sum and max necessity of a material family

Hello!

 

I'm trying to get the sum of all of stock of a material family and the maximum necessity of the same family. For example:

 

EstvoNogueira_0-1669058479009.png

 

The final objective is a list with the material families that i have less in stock than the necessary.

 

That's my table, note that de second column (necessity) i have 2 equals values (two recipes).

 

EstvoNogueira_1-1669056901112.png

 

Thank you!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @EstêvãoNogueira ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create tables.

 

sum data = SUMMARIZE(ALLSELECTED('Table'),'Table'[Family],"Meterial Description",BLANK(),"Quantity",SUM('Table'[Quantity]),"Necessity",MAX('Table'[Necessity]))
Table 3 = FILTER('Table','Table'[Quantity]<='Table'[Necessity])

 

(3)Then we can create a measure in [Table].

 

Measure = IF(SELECTEDVALUE('Table'[Quantity])<=SELECTEDVALUE('Table'[Necessity]),1,0)

 

(3) Then the result is as follows.

vtangjiemsft_0-1669108788637.pngvtangjiemsft_1-1669108808963.png

Picture1.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @EstêvãoNogueira ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create tables.

 

sum data = SUMMARIZE(ALLSELECTED('Table'),'Table'[Family],"Meterial Description",BLANK(),"Quantity",SUM('Table'[Quantity]),"Necessity",MAX('Table'[Necessity]))
Table 3 = FILTER('Table','Table'[Quantity]<='Table'[Necessity])

 

(3)Then we can create a measure in [Table].

 

Measure = IF(SELECTEDVALUE('Table'[Quantity])<=SELECTEDVALUE('Table'[Necessity]),1,0)

 

(3) Then the result is as follows.

vtangjiemsft_0-1669108788637.pngvtangjiemsft_1-1669108808963.png

Picture1.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

Excellent! It works like a charm. 


Thnaks very much!

amitchandak
Super User
Super User

@EstêvãoNogueira , Use Matrix Visual with Stepped layout off and try

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors