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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Mansoer09
New Member

Difference in values from the same column in the same table based on

Hi All

 

I have data stored in a table called "Data", i need to calculate the difference on a column called "Amount (GC)" based on another column called Source, the data in Source could either be METS or TMS in the source column. 

Mansoer09_0-1714718630355.png

 

So as an example the difference here would be  = (METS)9 990 658.3 - (TMS)6 834 819 = 3 155 839

 

1 ACCEPTED SOLUTION
Uzi2019
Super User
Super User

Hi @Mansoer09 
You need to create seperate measures for METS and TMS and do the minus operation
or create this dax under single measure


Final =
 var METS GC= calculate( sum(amount), Source= "METS")
var TMS= calculate (Sum(amount), Source= "TMS")
var Difference = [METS GC] - [TMS]

Return Difference

 

Or create seperate measure for individual calculation

1) METS measure
2)TMS measure
3) Diff meausre

I hope It may resolves your issue!

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

View solution in original post

3 REPLIES 3
Uzi2019
Super User
Super User

Hi @Mansoer09 
You need to create seperate measures for METS and TMS and do the minus operation
or create this dax under single measure


Final =
 var METS GC= calculate( sum(amount), Source= "METS")
var TMS= calculate (Sum(amount), Source= "TMS")
var Difference = [METS GC] - [TMS]

Return Difference

 

Or create seperate measure for individual calculation

1) METS measure
2)TMS measure
3) Diff meausre

I hope It may resolves your issue!

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Thanks Uzi, will give it a go

Hi @Mansoer09 
If my post/solution helps you. You can Accept as solution so other may find it quickly.

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.