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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
markefrody
Post Patron
Post Patron

Help With DAX for Nested IF Statements

Hi, 


I have this table:

markefrody_1-1671132726317.png

 

For example I want to get the weight of the following items with the following conditions and add them to another item with a set of different conditions:

Weight for products classified as "Toys" which has "Quality check = Yes" and "Safety check = Yes" 

+

Weight for products classified as "Appliance" which has "Quality check = Yes" and "Price check = Yes" 

=

Grand total weight of the filtered conditions


Would you be able to assist me to create a DAX based on the conditions above and be presented with an output similar to this?

markefrody_2-1671132848166.png

PS: I'm using Direct Query as storage mode.

Thanks and best regards,
Mark V.

1 ACCEPTED SOLUTION
Bifinity_75
Solution Sage
Solution Sage

Hi @markefrody , try this MEASURE:

 

Result = CALCULATE(sum(Table3[Weight (lbs)]),Table3[Classification]="Toys",Table3[Quality Check?]="Yes",Table3[Safety Check?]="Yes")+
CALCULATE(sum(Table3[Weight (lbs)]),Table3[Classification]="Appliances",Table3[Quality Check?]="Yes",Table3[Price Check?]="Yes")

 

The result:

Bifinity_75_0-1671222977478.png

 

Best Regards

 

 

View solution in original post

5 REPLIES 5
Bifinity_75
Solution Sage
Solution Sage

@markefrody , change the previous measure to this one:

Result = CALCULATE(sum('Table'[Weight (lbs)]),'Table'[Classification]="Toys",'Table'[Quality Check?]="Yes",'Table'[Safety Check?]="Yes")+
CALCULATE(sum('Table'[Weight (lbs)]),'Table'[Classification]="Appliances",'Table'[Quality Check?]="Yes",'Table'[Price Check?]="Yes")

 

Bifinity_75
Solution Sage
Solution Sage

Hi @markefrody , try this MEASURE:

 

Result = CALCULATE(sum(Table3[Weight (lbs)]),Table3[Classification]="Toys",Table3[Quality Check?]="Yes",Table3[Safety Check?]="Yes")+
CALCULATE(sum(Table3[Weight (lbs)]),Table3[Classification]="Appliances",Table3[Quality Check?]="Yes",Table3[Price Check?]="Yes")

 

The result:

Bifinity_75_0-1671222977478.png

 

Best Regards

 

 

@Bifinity_75. Thanks!

Bifinity_75
Solution Sage
Solution Sage

Hi @markefrody , try this calculate column:

Result = if ('Table'[Classification]="Toys" && 'Table'[Quality Check?]="Yes" && 'Table'[Safety Check?]="Yes",25,
            if ('Table'[Classification]="Appliances" && 'Table'[Quality Check?]="Yes" && 'Table'[Price Check?]="Yes",130,
            0))

 

The result:

Bifinity_75_0-1671138910610.png


Check your conditions for if statements.

 

Best regards

 

 

Hi @Bifinity_75 ,

Thank you for the response and assistance. I may have confused you with the conditional statements wherein I have mentioned the weight number. I have removed it, below is the corrected one:

Weight for products classified as "Toys" which has "Quality check = Yes" and "Safety check = Yes" 

+

Weight for products classified as "Appliance" which has "Quality check = Yes" and "Price check = Yes" 

=

Grand Total weight (lbs) of the filtered conditions




Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.