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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors