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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
JayFitchett
New Member

Creating a Measure with the DAX IN Operator

Hey there,

 

I'm trying to use the IN operator in the following formula but I'm not having any luck. 

 

Earned Hours Without PT = SUMX (
    FILTER (
        'Transactions',
        MID ( RELATED ( 'Account'[Secondary Code] ), 6, 1 ) IN { "1", "3" } 
    ),
    'Transactions'[Earned Hours]
)

When I add the measure to a table, i get the error "...The syntax for 'IN' is incorrect...". From what I can tell by seaching online, the IN operator seems to be supported and I think I'm using it correctly. If I use the OR function like this:

 

Earned Hours Without PT = SUMX (
    FILTER (
        'Transactions',
        OR ( 
            MID ( RELATED ( 'Account'[Secondary Code] ), 6, 1 ) = "1",
            MID ( RELATED ( 'Account'[Secondary Code] ), 6, 1 ) = "3"
        )
    ),
    'Transactions'[Earned Hours]
)

 

It works as expected without error. What am I missing? Am I using IN incorrectly?

1 REPLY 1
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @JayFitchett,

 

From your first formula, it seems that the syntax should be right.

 

I have made a test with the function similar with yours, but I haven't get any error.

 

Could you please paste the complete error message?

 

I would appreciate it if you could share a dummy pbix file which can reproduce your issue, so that we can help further investigate on it? You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading.)

 

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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