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

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.

Reply
rcb0325
Helper I
Helper I

Need help with a 'Summarize; function

Help! I am trying to calculate the number of RMAs that are due to shipping, but they are not totalling correctly. Currently, the dax is counting the number of 'Reason Codes', but you can see in the image that there are 6, and it is only showing a total of 3. It is also only looking for a certain 5 codes, that are due to shipping.

I believe I need to do a "=SUMX( SUMMARIZE(" type function, but cant seem get the expression right. You can see in the image that the 'shipped qty' is negative, because it was a return, and that there is an RMA # and Reason ID associated with each RMA. 

Capture.JPG

4 REPLIES 4
Anonymous
Not applicable

Hi @rcb0325 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.

 

Best Regards,

Rico Zhou

Anonymous
Not applicable

Hi @rcb0325 

Due to I don't know your data model, I build a sample to have a test.

Sample:

1.png

Try this measure:

Measure = 
var _T = SUMMARIZE('Table','Table'[No],"Count",
CALCULATE(COUNT('Table'[Description]),
'Table'[Code] = "SHB"||
'Table'[Code] = "SHE"||
'Table'[Code] = "SHO"||
'Table'[Code] = "SHS"||
'Table'[Code] = "SVE"))
VAR _SUM = SUMX(_T,[Count])
Return
_SUM

My sample is easy, you can add other columns you need into _T as below. You need to build a _T table looks like in table visual, then sum the count in it.

...
var _T = SUMMARIZE('Table','Table'[No],'Table'[Status],...(other columns),"Count",
...
...
Return

Or you can try  's way to sum the measure directly.

 SalesOrderNumber should be the key in your table use this column in values function.

Measure = SUMX(VALUES(DATA[SalesOrderNumber]),[# of RMAs due to shipping])

 

Best Regards,

Rico Zhou

 

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

 

Ashish_Mathur
Super User
Super User

Hi,

Does this work

Measure = SUMX(VALUES(DATA[ItemNumber]),[# of RMAs due to shipping])

Hope this helps. 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Fowmy
Super User
Super User

Check your Code field that is in the Calculate filter, not sure if the values are as mentioned in the filter. Could be dome space or special characters

 

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.