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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply

Elegant function for filtering using more than two critera

Hey hey fine folk of PBI!

Trying to create a reusable measure of customer sales per region, the issue is that the database does not have the regions setup.

My need is something like this

Count all sales for customers in asia.

Asia_sales = CALCULATE(COUNT(RawDataTable[Total Sales]);
FILTER(RawDataTable;(RawDataTable[Company location] = "Indonesia North" && (RawDataTable[Company location] = "Indonesia South") && (RawDataTable[Company location] = "Indonesia east") 

Above was just an example to get the gist of what I'm trying to accomplish. Any tips for how to do this in the most "elegant" way?

In the end, I will try to SUM the data by region with all the data of the companies included. Thanks!
3 REPLIES 3
RickPowerBI
Helper I
Helper I

Hi @CauseAndEffect,

 

Try using FIND or SEARCH, You would get something like this:

(Bare in mind, i'm not an expert so this may not work at all but it may give you an idea of how to fix your problem)

Asia_sales = 
CALCULATE ( COUNT ( RawDataTable),
FILTER ('RawDataTable',
NOT (
ISBLANK (
FIND ("Indonesia North", [Company location], , BLANK ())))
|| NOT (
ISBLANK (
FIND ("Indonesia South", [Company location], , BLANK ())))
|| NOT (
ISBLANK (
FIND ("Indonesia east", [Company location], , BLANK ()))),
[Total Sales])

 

Solved it, just created a Calculate using the correct syntax

New Measure ->

 

00_Countryfilter = CALCULATE(COUNT(RawDataTable[Sales]);
RawDataTable[Store Location] = "Indonesia East" ||
RawDataTable[Store Location] = "Indonesia West" ||
RawDataTable[Store Location] = "Indonesia South" ||
RawDataTable[Store Location] = "Japan South" ||
RawDataTable[Store Location] = "Japan South IKU")

Optimally i need to use an unlimied amount of filters since our customer location column has over 2k unique locations.

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.