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
LesNOS482
New Member

IN OPERATOR with Variable List

NEWB alert. apologies in advance.

I'd like to filter my results based on a previously generated list, in this case the months included need to be limited to only those included in the list - here because the variable IN isn't working after 2 days of trying.

$perMD =

var POSTMONTHS = 
SUMMARIZE(FILTER(table, table[Report Window] = "Post"
&& table[xFilter] = "I"),
table[PRMONTHID])


return

CALCULATE(
DIVIDE(
table[$ Payments],
table[MDs]),
table[Report Window] = "Before",
FILTER(table, [PRMONTHID] IN (POSTMONTHS)))

many thanks

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @LesNOS482 

If you want to filter list by another list, the function that may be relevant is INTERSECT(<table_expression1>, <table_expression2>)

But this is just a guess, a more specific example is needed for confirmation.

usually information below is needed, could you provide it? Thanks.

 (1) a sample file, you can replace raw data with bogus data to protect your privacy.

     or provide some sample data that fully covers your issue/question.

(2) give your expected result and its math formula based on the sample you provide.

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

davehus
Memorable Member
Memorable Member

Hi @LesNOS482, Not really sure about your model structure but all reads as if it's from the same table of data. Could you create a calculated column to indicate the post months and then apply it as a filter context in the final calculation? 

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.