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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

how to get the sum of different values using dax

Hello Team,

My data has SKUs and their quantities. For example:

RegionSkuQty
R1SKU1300
R2SKU1300
R3SKU1300
R1SKU2500
R2SKU2500
R3SKU2500
R4SKU2500
R5SKU2500

Let's say I'm showing this data in a line chart and not taking into account the regions I have.

I want to show the sum of the sale of quantities other than SKUs and not sum all of these. For example: I would like to show the total use of SKUs is (300+500 to 800).

But right now if I'm summarizing the column, I'm getting full sum like 500*5+300*3 (which is obvious).

Is there any way through which I can achieve the total amounts to be 800 apart from the other number.

Also, making an average will not work as SKUs are not repeated equally number of times. There could be 2 or more SKUs with the same amount, so you want to make sure that both quantities are added

Thank you in advance

@Greg_Deckler @amitchandak @ImkeF

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@RohanChhabra ,

Please try as a

sumx(summarize(table,table[SKU],"_max",max(table[QTY])),[_max])
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Thanks a lot everybody for helping.

However, I tried the method shared by @amitchandak and it worked for me

 

Again, thanks y'all for providing your solutions.

 

Best Regards,

Rohan

 

Anonymous
Not applicable

Hi @Anonymous ,

You can create one measure as below:

Sum of distinct values = SUMX(SUMMARIZE(DISTINCT('table'[SKU]),'table'[SKU],"Quantity",DISTINCT('table'[Qty])),[Quantity])

sum of distinct values.JPG

Best Regards

Rena

Ashish_Mathur
Super User
Super User

Hi,

Write these measures

Quantity = MIN('Table'[Qty])

Measure = SUMX(VALUES('Table'[SKU]),[Quantity])

Hope this helps.


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

@RohanChhabra ,

Please try as a

sumx(summarize(table,table[SKU],"_max",max(table[QTY])),[_max])
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks a lot

Tahreem24
Super User
Super User

Try below Dax measure:
Measure = Calculate(sum(Table[Qty]), AllExcept(Table, Table[SKU]))

Don't forget to give Thumbs up and accept this as a solution if it helped you.
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors