Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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
Solved! Go to Solution.
@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])
Proud to be a Super User! |
|
According to the dataset you passed, you have to use ABS
NOACTIONED = ABS([TOTALCOUNT] - [ACTION])
Or just to do:
NOACTIONED = [ACTION] - [TotalCOUNT]
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.
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.
According to the dataset you passed, you have to use ABS
NOACTIONED = ABS([TOTALCOUNT] - [ACTION])
Or just to do:
NOACTIONED = [ACTION] - [TotalCOUNT]
@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])
Proud to be a Super User! |
|
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 88 | |
| 82 | |
| 68 | |
| 64 |