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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
DM_95
Helper I
Helper I

Grand Total of measure is not correct

Hi,

 

I want to calculate the total of measure 'Available Stock M²' (see below for DAX formula). On Article level (Artikelnummer) the calculation is fine but on Total level I want a different result --> the sum of all available stock m² per article 

 

For Example: for Item Number BELL2020/010010/100 I have 18756 Physical Stock M² and 9000 Open Orders M², so available stock is 9756 sqm. For Item Number DIY1GAAS/001001/160 I have 91006 Physical Stock M² and 2736 Open Orders M², so available stock is 88270 sqm. For 2 item numbers I already have 98026 m² of available stock in total. However, on Total level I only have 58725 m² of available stock. Can someone help me with the result I want to achieve?

 

DM_95_0-1712261251102.png

 

Thanks!

 

2 ACCEPTED SOLUTIONS
MFelix
Super User
Super User

Hi @DM_95 ,

 

This is related with context since you are using a IF syntax.

 

Try to add the following measure:

 

Available Stock Final = SUMX( VALUES(Table[Artikelnummer]), [Available Stock M²])

This is a new measure that you can use on your matrix.

 

Check this article for a better explanation:

https://www.sqlbi.com/articles/why-power-bi-totals-might-seem-inaccurate/


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

Anonymous
Not applicable

Hi @DM_95 ,

As @MFelix  said it's the measure context. You can try my method so that you can get the correct value at the article level and also at the total level.

Create the result measure based on the [Available stock m].

result = 
var _b = SUMMARIZE('table','table'[artikenumber],"aaa",'table'[Available stock m])
return
IF(HASONEVALUE('table'[artikenumber]),[Available stock m],SUMX(_b,[aaa]))

 

 

How to Get Your Question Answered Quickly - Microsoft Fabric Community

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

2 REPLIES 2
Anonymous
Not applicable

Hi @DM_95 ,

As @MFelix  said it's the measure context. You can try my method so that you can get the correct value at the article level and also at the total level.

Create the result measure based on the [Available stock m].

result = 
var _b = SUMMARIZE('table','table'[artikenumber],"aaa",'table'[Available stock m])
return
IF(HASONEVALUE('table'[artikenumber]),[Available stock m],SUMX(_b,[aaa]))

 

 

How to Get Your Question Answered Quickly - Microsoft Fabric Community

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

 

 

 

 

MFelix
Super User
Super User

Hi @DM_95 ,

 

This is related with context since you are using a IF syntax.

 

Try to add the following measure:

 

Available Stock Final = SUMX( VALUES(Table[Artikelnummer]), [Available Stock M²])

This is a new measure that you can use on your matrix.

 

Check this article for a better explanation:

https://www.sqlbi.com/articles/why-power-bi-totals-might-seem-inaccurate/


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.