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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.