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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.