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
Hashiru
Helper I
Helper I

How to Query a Field with long list of Items to Exclude a few Items

I all,

 

I have a DAX Query to filter my dataset to a subset for further analysis. However, the list of Items in the field is long and I am seeking a better way to do this. Here is the query I got so far

 

EVALUATE
FILTER(
       PreviousData,
       AND(
            AND(
                PreviousData[System Source]="BP" ||PreviousData[System Source]="BL" ||   PreviousData[System Source]="BL" ,
                PreviousData[Type]="OL" ||PreviousData[Type]="UF" ||  PreviousData[Type]="YB"

               ),
            AND(
                PreviousData[Activity]="Alpha" ||PreviousData[Activity]="Beta" ||   PreviousData[Activity]="Labda" ,
                PreviousData[Fund]="2016" ||PreviousData[Fund]="2018" ||  PreviousData[Fund]="2018"

               )
       )
       //NOT(LEFT([Activity],5)="Any item")
)

 

The list goes in the third AND Function in the query for Activity and Fund with at least 50 items between them.

 

Thanks

2 REPLIES 2
Anonymous
Not applicable

Is it an option to use Power Query?  If so, I'd try to go that route or else you'll be typing forever and it will more than likely be slow 

Thanks Nick_M,

 

I like your suggestion, however, I am modeling for a whole department and the same dataset will have to be tweaked in different ways and the power query method will be to costly in terms of memory. I have cumulative data five years plus in a big organization. (I guess Power Query Table.SelectRows will do it for this situation but to many table will be created).

 

I am also exploring Power BI DAX IN function (Released December 2018). I tried it with a few items it worked. I am also going to try it in Power Pivot (as I am also creating same in Excel) when IT update my office.

 

 

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.