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

Subtracting from same column and then add up the difference

Varez42_0-1678877199949.pngI have data kind of similar to this excel file in the PQ, I would like to get the difference of value column between sent and reci(att column) for each unique event ID

I was able to get that where for a the measure would be 10 and for b it would be 15 and for c 0 but the total is not adding up as it should be 25 
I am trying to calculate it like this

Varez42_0-1678897116005.png

Varez42_1-1678897136044.png

 

 



Can some one help me with this,please?

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Varez42 

please try

=
SUMX ( 'Table', IF ( 'Table'[att] = "reci", - 'Table'[Value], 'Table'[Value] ) )

View solution in original post

3 REPLIES 3
tamerj1
Super User
Super User

Hi @Varez42 

please try

=
SUMX ( 'Table', IF ( 'Table'[att] = "reci", - 'Table'[Value], 'Table'[Value] ) )

Varez42
New Member

HI @KeyurPatel14 
thanks for the response, 
So based on the above data , I am trying something like this but as you can see the total should be 50 but it is not .

Varez42_0-1678887942160.png

Varez42_1-1678887961784.png

 

KeyurPatel14
Resolver IV
Resolver IV

Hi @Varez42 ,
Can you please provide sample output for better understanding?

Helpful resources

Announcements
Exciting changes

Power BI Community Changes

Check out the changes to the Power BI Community announced at Build.

May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Kudo Data Story carousel

Data Stories Gallery

Visit our Data Stories Gallery and give kudos to your favorite Data Stories.

Top Solution Authors