Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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:
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).
Thank you!
Solved! Go to Solution.
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.
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.
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.
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!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!