cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dillontoramall
Frequent Visitor

Need assistance with writing a measure

Hello,

 

Pretty much, I have two fields of data that I'm trying to connect through a measure and determine the difference between two totals that are categorized by a code. For example:

 

Field 1                                             

Code         Amount

ABC             100

DEF              200

GHI              300

 

Field 2               

Code         Amount

ABC             50

DEF             100

GHI             150

 

In my actual data, both "Code" lines are linked via the relationship manager, but when I write a measure subtracting the respective Amounts, I don't get the correct answer. I should be getting ABC = 50, DEF = 100 and GHI = 150 if I'm creating a measure to subtract the amounts by Code.

 

Can someone please help me as to what I should be writing as a measure to correctly subtract the two? Thank you for your help.

1 ACCEPTED SOLUTION
sayaliredij
Solution Supplier
Solution Supplier

You can create measure using the following code

 

Diff = SUM(Field1[amount]) - SUM(Field2[amount])

 

Make sure Code from both tables connected with relationship both directional

 

Regards,

Sayali

If this post helps, then please consider Accept it as the solution to help others find it more quickly.

View solution in original post

1 REPLY 1
sayaliredij
Solution Supplier
Solution Supplier

You can create measure using the following code

 

Diff = SUM(Field1[amount]) - SUM(Field2[amount])

 

Make sure Code from both tables connected with relationship both directional

 

Regards,

Sayali

If this post helps, then please consider Accept it as the solution to help others find it more quickly.

View solution in original post

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Top Solution Authors
Top Kudoed Authors