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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
bzeeblitz
Helper IV
Helper IV

Measure calculation subtraction

I have below table visuals and I need to calculate subtraction 

 

NOTACTIONED output is Totalcount-Action and it should not be negative 

 

Date.          TOTALCOUNT.   ACTION  NOACTIONED

13/3/25.        20.                   62.             42

3 ACCEPTED SOLUTIONS
bhanu_gautam
Super User
Super User

@bzeeblitz Open your Power BI report and select the table visual where you want to add the NOACTIONED column.
Click on the "Modeling" tab and then "New column" to create a new calculated column.
Enter the following DAX formula:

NOACTIONED = IF([TOTALCOUNT] - [ACTION] < 0, 0, [TOTALCOUNT] - [ACTION])




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

Cookistador
Super User
Super User

According to the dataset you passed, you have to use ABS
NOACTIONED = ABS([TOTALCOUNT] - [ACTION])

 

Or just to do:

NOACTIONED = [ACTION] - [TotalCOUNT]

View solution in original post

randomUser21
Resolver I
Resolver I

NOTACTIONED = MAX(0, [TotalCount] - [Action])

  • [TotalCount]-[action]: This part calculates the difference between the two measures [TotalCount] and [action].

  • max(0,..) The max function ensures that if the result of the subtraction is negative, it will return 0  instead of a negative number. Essentially, this function compares 0 with the calculated result, and returns the larger of the two. So, if the difference is negative, it will return 0 , and if it's positive, it will return the actual difference.

View solution in original post

3 REPLIES 3
randomUser21
Resolver I
Resolver I

NOTACTIONED = MAX(0, [TotalCount] - [Action])

  • [TotalCount]-[action]: This part calculates the difference between the two measures [TotalCount] and [action].

  • max(0,..) The max function ensures that if the result of the subtraction is negative, it will return 0  instead of a negative number. Essentially, this function compares 0 with the calculated result, and returns the larger of the two. So, if the difference is negative, it will return 0 , and if it's positive, it will return the actual difference.

Cookistador
Super User
Super User

According to the dataset you passed, you have to use ABS
NOACTIONED = ABS([TOTALCOUNT] - [ACTION])

 

Or just to do:

NOACTIONED = [ACTION] - [TotalCOUNT]

bhanu_gautam
Super User
Super User

@bzeeblitz Open your Power BI report and select the table visual where you want to add the NOACTIONED column.
Click on the "Modeling" tab and then "New column" to create a new calculated column.
Enter the following DAX formula:

NOACTIONED = IF([TOTALCOUNT] - [ACTION] < 0, 0, [TOTALCOUNT] - [ACTION])




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.