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.

View discussion in a popup

Replying to:
Anonymous
Not applicable

FILTER function with a List as filter condition

Hello everyone!

 

I have a customer who does a lot of different filterings, i.e. for Article groups and subgroups, location groups and subgroups, including changing overlap and changing groups. To have one measure to sum them up, I thought I would work with a variable list in the filters, like this:

msrQuantity =

VAR
    ItemList = "12345, 54321"

RETURN
    CALCULATE(
        SUM(InventoryData[QTY]),
        FILTER(
        InventoryData,
        InventoryData[ItemNumber] IN {ItemList}
        )
    )

 

Ultimately, the ItemList would be a CONCATENATEX-Function, and there will be additional conditions added.

 

The function only returns data if the list is a single value (i.e. were it only "12345", I get the right item. I also tried putting them further into brackets like "{12345}, {54321}", but that doesn't change the table, either.

 

Is this possible, or are there better ways to achieve this?