cancel
Showing results for
Did you mean:
Helper II

## Condition overwriting the other conditions

Hi all,

I'm trying to get the total with the following conditions:

1. IsNet = True

2. SupplierCode = only selected code (say 1102 and 1103)

3. Specifically just for CompanyCode 6601, I would like to get the total even though IsNet is False (selected supplier code still applies)

Not sure what's the best approach. I tried to create custom column with IF statement creating True/False but, I can't get all the conditions.

This is what the data looks like:

 Company Code IsNet SupplierCode Total 6601 True/False 1101 6602 1102 6603 1103 6604 1104

Any help would be appreciated!!

1 ACCEPTED SOLUTION
Super User IV

Create the following measure:

``````Total Measure =

CALCULATE(
SUM(Table2[Total]),
Table2[IsNet] = TRUE()
)
+
CALCULATE(
SUM(Table2[Total]),
Table2[Company Code] = 6601
)``````
Did I answer your question? Mark my post as a solution! and hit thumbs up
6 REPLIES 6
Super User IV

Do you need a measure that gives you the total based on your conditions? IF so, which column should I sum?
For the SupplierCode, hope you will have a slicer in the report.

Did I answer your question? Mark my post as a solution! and hit thumbs up
Helper II

Yes, I need the sum of Total column based on the conditions.

As for slicer, does filter for suppliercode works as well? Or, does it have to be a slicer?

Super User IV

Create the following measure:

``````Total Measure =

CALCULATE(
SUM(Table2[Total]),
Table2[IsNet] = TRUE()
)
+
CALCULATE(
SUM(Table2[Total]),
Table2[Company Code] = 6601
)``````
Did I answer your question? Mark my post as a solution! and hit thumbs up
Helper II

It looks like it works but I need to double check the result.

Also, want to double check the following. I need to create another measure where the condition is the opposite of the measure that you created. This time, I do not want to include company code 6601 and IsNet = false.

Does the following measure correct?

CALCULATE(
SUM(Table2[Total]),
Table2[IsNET] = FALSE()
)
+
CALCULATE(
SUM(Table2[Total]),
Table2[Company Code] <> 6601
)

Super User IV

Yes, it should work, test and update please.

Did I answer your question? Mark my post as a solution! and hit thumbs up
Helper II

I believe it works, thx!

Announcements

#### Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.