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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
JayReidy
Frequent Visitor

Sum column by distinct values of another column

Hey

I have a table, simplified has these values

nameEmail$$$
Campaign1test1@email.com1000
Campaign2test2@email.com2500
Campaign2test3@email.com500
Campaign1test3@email.com5000
Campaign2test1@email.com850


I want to create a measure to sum all the $$ amounts that are a reference to another tables column. In a table that would look like this

name$$
Campaign1$6000
Campaign2$3850


I was trying to use =SUMX(DISTINCT(campaign[email]),campaign[othertable.$$])) 

But it won't let me use the other tables column in the measure, I've made this column using advanced editor and extracting that information from relationship fields.

What am I doing wrong here?

Sorry for the terrible formatting of tables it's the first one I've done and I kept getting HTML errors

4 REPLIES 4
FreemanZ
Super User
Super User

hi @JayReidy 

as you have already get the campaign[othertable.$$] column with Power Query Editor, you can just try:


measure = SUMX(campaign),campaign[othertable.$$]))

 

Or?

tamerj1
Super User
Super User

@JayReidy 

Please try

=SUMX(DISTINCT(campaign[email]),RELATED(campaign[othertable.$$])))

No doesn't work sorry forgot to mention this is an indirect relationship

@JayReidy 
Please try

=
SUMX (
    DISTINCT ( campaign[email] ),
    SUMX (
        FILTER ( othertable, othertable[email] = campaign[email] ),
        othertable[Value.$$]
    )
)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.