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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Helpful_Fun4848
Helper III
Helper III

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 CodeIsNetSupplierCodeTotal
6601True/False1101 
6602 1102 
6603 1103 
6604 1104 

 

Any help would be appreciated!!

1 ACCEPTED SOLUTION

@Helpful_Fun4848 

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


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

6 REPLIES 6
Fowmy
Super User
Super User

@Helpful_Fun4848 

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.

Please explain

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


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

@Fowmy 

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?

@Helpful_Fun4848 

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


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

@Fowmy 

 

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
)

 

@Helpful_Fun4848 

Yes, it should work, test and update please.

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


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

@Fowmy 

 

I believe it works, thx!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors