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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors