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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Sum filter with more than 3 arguments?

My goal is to sum up three different wage distribution containers, with a filter for both the year, and the geography. Including the year was no problem. However, including the geography too, broke the filter. OR only accepts two arguments, so I'm unsure how to add three, or even more filters.

 

 

 

Under 30k = 
CALCULATE(
    SUM('Wage Distribution'[Total Population]),
    FILTER (
            'Wage Distribution',
        OR(OR (
            'Wage Distribution'[Wage Bin]="< $10K",
            'Wage Distribution'[Wage Bin]="$10-20k"),
            'Wage Distribution'[Wage Bin]="$20-30k",
            
        )
            && 'Wage Distribution'[ID Year]=2018
            && 'Wage Distribution'[Geography]="Florida"
    )
)

 

 

How do I add in 'Wage Distribution'[Geography]="Florida", or even, another filter after that? 

5 REPLIES 5
Anonymous
Not applicable

Hi @Anonymous,

It seems like you are try to do rolling calculations based on a text field.

In my opinion, I'd like to suggest you add a calculated field to extract the 'bin range'(numeric type) from the text value field.
Then you can use simple conditions in your formula for cumulative calculations without broken/effect on filters and your records.

Regards,

Xiaoxin Sheng

AllisonKennedy
Super User
Super User

@Anonymous
Hi! Looks like you are struggling with this particular measure.

Couple of things, first:
AND() and OR() DAX functions only accept two arguments, but you may use && and || operators instead, so

OR (
'Wage Distribution'[Wage Bin]="< $10K",
'Wage Distribution'[Wage Bin]="$10-20k")

is the same as


'Wage Distribution'[Wage Bin]="< $10K"
||
'Wage Distribution'[Wage Bin]="$10-20k"

That way you may add as many conditions in the filter as you want.

Second: You need to logically decide when to use AND /&& versus when to use OR/ ||

Your formula above looks ok for adding geography, but depends if you actually have data for 2018 Florida in one of those wage distributions?

Final thought: What is your ultimate goal? This looks like a lot of specific filters to place in a measure and this could be done using slicers and report visuals.
https://docs.microsoft.com/en-us/power-bi/visuals/power-bi-visualization-slicers

You can even use Grouping to group the wage distribution how you would like:
https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-grouping-and-binning

Hope that helps some!

Cheers!

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

amitchandak
Super User
Super User

@Anonymous , try like

Under 30k = 
CALCULATE(
    SUM('Wage Distribution'[Total Population]),
    FILTER (
            'Wage Distribution',
            'Wage Distribution'[Wage Bin] in {"< $10K","$10-20k","$20-30k"}
            && 'Wage Distribution'[ID Year]=2018
            && 'Wage Distribution'[Geography]="Florida"
    )
)
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

Try IN instead of OR

 

Under 30k =
CALCULATE (
    SUM ( 'Wage Distribution'[Total Population] ),
    FILTER (
        'Wage Distribution',
        'Wage Distribution'[Wage Bin]
            IN {
            "< $10K",
            "$10-20k",
            "$20-30k"
        }
            && 'Wage Distribution'[ID Year] = 2018
            && 'Wage Distribution'[Geography] = "Florida"
    )
)

 

Else use ||  

 

Regards,

Harsh Nathani

Excellent response, not wise who accepted the IN function in DAX, that is very functional. You have opened up the picture for me. Thank you very much, excellent contribution.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.