cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Joranger
New Member

SUM of VALUE based on SELECTED VALUES in one table.

Hi everyone!

 

First off, Im very new at using DAX. 

I have an table with some prices on products that I want an measure to sumarize based on what I select in said table. 

 

Thus far I have this:

Total SUMX(VALUES(_liste[Pris]), _liste[Pris])
 
Problem with this is when two products have the same price, it won't sum the two prices.
 
Thanks for any help! 
1 ACCEPTED SOLUTION
Adescrit
Super User
Super User

Hi @Joranger 

 

If you want to some all of the prices, regardless of whether they are duplicate values or not, perhaps you can use a simple SUM rather than SUMX?

 SUM( _liste[Pris] )


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

View solution in original post

3 REPLIES 3
Adescrit
Super User
Super User

Hi @Joranger 

 

If you want to some all of the prices, regardless of whether they are duplicate values or not, perhaps you can use a simple SUM rather than SUMX?

 SUM( _liste[Pris] )


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

Oh dear God... Yup, that did it. Thank you so much!

AjithPrasath
Resolver II
Resolver II

@Joranger ,

  Can you try using disitinct in your dax query?

Total = SUMX(DISTINCT(_liste[Pris]), _liste[Pris])

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Top Solution Authors