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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
yann75
New Member

Need help to fixe my matrice total (sumx ?)

I have a matrice:

yann75_1-1689236940725.png

 

 with some product name, reference line, stock quantity of the product, model stock of the product in different wharehouse, the gap between stock quantity and model stock, and the model stock covery


the dax code for the gap is : 

Abs(Case(([Stock Qty APAC] < [Model Stock APAC]); ([Stock Qty APAC] - [Model Stock APAC]); 0))


So in the total, there is a lot more of stock quantity than in model stock so there is no ecart at all, and i have a covery of 100%


How could i change my code for having a total which represents rows where the model stock is actually >of the stock quantity and where i have real stock covery ?

I'm desesperate with if for two days now, if someone can help me 🙂 



I tried to put 0 every time the stock quantity is > tothe model stock, but the problem is the same :

the calculation of the total is carried out at the level of the line so in this case, it is the stock model which is greater than the stock quantity and suddenly this one is displayed at 0, and I therefore have no difference





1 REPLY 1
lbendlin
Super User
Super User

Please provide sample data (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...

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.