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
PowerBINoob12
Helper I
Helper I

how to take two values from a column and subtract them from each other

Hi

i'm trying to figure out how to subtract the two values in the column "count" from each other.

This is a filtered table so I cant pivot it etc.

hoping there is some code that will put each value in a variable and then I can subtract them after.

PowerBINoob12_0-1682006430940.png

any advise would be greatly appreciated.

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@PowerBINoob12 

You can write a measure to calculate each amount then subtract the measures.

Total Count = CALCULATE ( SUM ( 'YourTable'[Count] ), 'YourTable'[Metric] = "Grand Total" )
Manual Count = CALCULATE ( SUM ( 'YourTable'[Count] ), 'YourTable'[Metric] = "Manual" )
Difference = [Total Count] - [Manual Count]

View solution in original post

2 REPLIES 2
PowerBINoob12
Helper I
Helper I

Thank you so much for your help - this was slowly draining the life from me 🙂

 

jdbuchanan71
Super User
Super User

@PowerBINoob12 

You can write a measure to calculate each amount then subtract the measures.

Total Count = CALCULATE ( SUM ( 'YourTable'[Count] ), 'YourTable'[Metric] = "Grand Total" )
Manual Count = CALCULATE ( SUM ( 'YourTable'[Count] ), 'YourTable'[Metric] = "Manual" )
Difference = [Total Count] - [Manual Count]

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.