# SUM of Positives and SUM of Negatives from the same row

Dear Support Forum members,

My data file has columns showing different discount rates by type of discount/markup applied on a single line in a sales order. Each row indicates a line in an order with a specific material. I would like to calculate two “calculated columns” - one showing a sum of positive values and one showing a sum of negative values since there will be multiple rates applied on one line depending on different categories. I am not able to figure out a DAX formula without having to create a negative and positive for each type of rate and then summing them up in 2 calculated columns. One other thing just to be clear - a single column i.e. one type of discount can have positive and negative values.
Test_Disc_Positive_Negative.xlsx (11.0 KB)

Create a calculated columns like below.

Positive and Negative.pbix (27.3 KB)

1 Like

@a_nimish

Here is another approach using Table constructor

Positive and Negative.pbix (28.5 KB)

1 Like

@a_nimish

Here is the simple solution using variables

Positive and Negative.pbix (30.2 KB)

Thank you so much, Rajesh. Very helpful! I understood the simple solution using variables, but I didn’t quite follow the other two. Is there any reading material to understand the solution you have created with calculated column (UNION method)?

1 Like

@a_nimish

For each row, creating a table like below using UNION and ROW

To sum only Positive apply filter on Check = Positive.

Second Solution: Creating the same table using Table Constructor.
When we create Table using Table Constructor first column is Value1 and Second Column is Value2…

Hope this clarifies.

Hello @a_nimish! Welcome to the forum It’s great to know that you are making progress with your query.