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

Expression help

My expression below is meant to return 'No' for the sum of Females from South Dakota and exclude Males from the sum of Iowa, Delaware, and South Dakota so neither display in the table. 

If([States]='South Dakota','No', Sum({<[States] = {'Iowa' , 'Delaware'},[Gender] - = {'Male'}>}[Population]))

Essentially, I want the expression to turn this table…

States

Gender

Population

Totals

 

4,414,133

South Dakota

Male

270,597

Iowa

Male

1,435,515

Delaware

Male

452,689

South Dakota

Female

281,598

Iowa

Female

1,490,809

Delaware

Female

482,925

 

into this table…

States

Gender

Population

Totals

 

1,973,734

South Dakota

Female

No

Iowa

Female

1,490,809

Delaware

Female

482,925

 

 Can you help?

1 Solution

Accepted Solutions
rubenmarin

Hi, you were very close:

If([States]='South Dakota' and Gender='Female', 'No', Sum({<[States] = {'Iowa' , 'Delaware'},[Gender] -= {'Male'}>}[Population]))

Add gender to the first If, so it doesnt' shows "South Dakota"-"Male", and remove the space between '-' and '=' in [Gender] - = {'Male'}

View solution in original post

1 Reply
rubenmarin

Hi, you were very close:

If([States]='South Dakota' and Gender='Female', 'No', Sum({<[States] = {'Iowa' , 'Delaware'},[Gender] -= {'Male'}>}[Population]))

Add gender to the first If, so it doesnt' shows "South Dakota"-"Male", and remove the space between '-' and '=' in [Gender] - = {'Male'}