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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
rrafferty37
Helper I
Helper I

Surprise - total not adding up correctly

My story begins like many others before me. A simple measure that does exactly what I want:

 

001 QTY = if([NetQTYR12] = 0, blank(),

CALCULATE(
    SUM('Item Availability'[Qty Avl]),
    'Item Availability'[Location] = "111",
    all('tem Availability'[Location]),
    all('Accounts'[Account Name])))

I have a matrix table that is filtered to one specific account via a slicer (table name Accounts)

In this Table I pull in the inventory available in a location specific to that account.
I want to see what inventory is available in our general location that houses most of our product.  

The measure works great, but the total is totaling everything in Location 111 instead of just within the context of my other filters (If the account I am filtered on carries a product I want to see that, but if it doesn't carry that product I don't want to see the inventory from location 111 in my total.  

 

I have tried a few variations of IF(HASONEFILTER( + some combination of SUMX to no avail.

PBI #1.JPG

The 111 QTY is not totaling correctly.

 

Thank you for any help!!

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

Have you looked at this Quick Measure, Measure Totals, The Final Word?
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

Have you looked at this Quick Measure, Measure Totals, The Final Word?
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

What a great resource, thank you! Took maybe 10-15 minutes to play around with the suggested solution based on how my table was set up and really understanding how it was being summraized.  Thank you so much! 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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