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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
JuanPabloCarr
New Member

distinct add with repeated values

Hi, i got the following problem:

We have purchase orders for materials, these are received little by little by the suppliers, so repeated rows of the same order are created as the materials are received as follows:

|Purchase order|

|product|

|quantity order|

|recibed|

|money|

1

wood

30

10

100$

1

wood

30

20

100$

2

door

20

20

50$

3

window

15

10

300$

3

window

15

5

300$


How can I sum the amount of money without repeating the amounts depending on the purchase order?

1 ACCEPTED SOLUTION

@JuanPabloCarr 

Measure = CALCULATE(SUMX(VALUES(tbl[|money|]),tbl[|money|]),ALL(tbl))

 

smpa01_0-1675877787452.png

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

6 REPLIES 6
smpa01
Super User
Super User

@JuanPabloCarr  what is the desired end goal based on the sample data

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

i need a measure to sum 450 (1wood + 1door + 1windows) and not 850 (2wood + 1door +2windows)

@JuanPabloCarr 

Measure = CALCULATE(SUMX(VALUES(tbl[|money|]),tbl[|money|]),ALL(tbl))

 

smpa01_0-1675877787452.png

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

That works for me, thanks!

FreemanZ
Super User
Super User

hi @JuanPabloCarr 

try like:

Measure =
VAR _table =
ADDCOLUMNS(
   VALUES(TableName[Purchase order]),
   "Money",
   CALCULATE(MAX(TableName[Money]))
)
RETURN
SUMX(_table, [Money])

it isnt working, the code return the same value as if i sum all the values of the column "Money", counting the repeated ones

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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