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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors