Forum Discussion
Measure calculation subtraction
- 1 year ago
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])
- 1 year ago
According to the dataset you passed, you have to use ABS
NOACTIONED = ABS([TOTALCOUNT] - [ACTION])Or just to do:
NOACTIONED = [ACTION] - [TotalCOUNT]
- 1 year ago
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.