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
jamontes
Regular Visitor

Adding up with SUMX mesure

Hi everybody. I have a problem whith the ading up in a sumx mesure whit a filter. I hope someone here could healp me to solv this issue.

Here we go:

 

I have a db with the Acomulative Inventory by each SKU. I have to take out the inventory at the last date of the pivote table filter.

This is te data:

N° SequenciaDatemov tipoMODELSKUMovStock Ac.
125-05-2018BUYLeterA55
226-05-2018BUYLeterB66
326-05-2018BUYLeterC77
426-05-2018BUYLeterD77
527-05-2018SALELeterA-16
628-05-2018SALELeterA-14
729-05-2018SALELeterC-16
801-06-2018SALELeterA-13
901-06-2018SALELeterA-12
1002-06-2018SALELeterB-24
1102-06-2018SALELeterD-16
1205-06-2018SALELeterC-33
1307-08-2018SALELeterB-13
1407-08-2018SALELeterC-12
1510-06-2018SALELeterD-24
1610-06-2018SALELeterD-13
1710-06-2018BUYLeterB14
1811-06-2018VALUELeterD03
1912-06-2018SALELeterD-21

This is the pivot table:

 

DateMODELSKUStock Ac.
MayoleterA4
  B6
  C7
  D7
 TOTAL 7
JunioleterA2
  B4
  C3
  D1
 TOTAL 4
AgostoleterB3
  C2
 TOTAL 3
Total general  7

The mesure of "Stock Ac" is:

 

=SUMX(FILTER(Table1,Table1[N° Sequencia]=MAX(Table1[N° Sequencia])),Table1[Stock Ac.])

 

Its gives to me the correct record by row, but the add up it's wrong. How can i get the correct subtotal and grand total?

I´tried with this other measure

=SUMX(FILTER(Table1,Table1[N° Sequencia]=MAX(Table1[N° Sequencia])),SUM(Table1[Stock Ac.]))

But this is wrong in the record by row and also in the adding up.

 

1 REPLY 1
Greg_Deckler
Super User
Super User

This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
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...

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.

Top Solution Authors