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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

lookup values from another table, if values exist in another table, return 1 to get the filter show

Hi, experts, I have two tables, dimension table and fact table, I created a filter use column from dimension table, but fact table may not exist some values in dimension table, and I need to make sure all the values from the fiters selected has relevant data, do you have any ideas?

My idea is that creat a measure in the dimension table, when the value from fact table exist in dimension table, then return 1, else 0, and apply this measure to the filter, but the measure crteated is not work.

here is the sample data and expected result:

dimsention table

region

A

B
C

fact table

regiondata
Aadaf
Cfadfa

expected result:

regionmeasure
A1
B0
C1

I created mesure like this: 

measure=

VAR _fact=MAX('fact'[region])

VAR _dim=MAX('dim'[region])
RETURN IF(_fact=_dim,1,0)
but the measure did not work
do you know how to how to make this measure correct or any other ideas on make the slicer show only relevant data?
1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

You may try this measure

Measure = 
var __values = VALUES('Fact'[region])
return
IF(SELECTEDVALUE('Dimension'[region]) IN __values, 1, 0)

vjingzhang_0-1671807265106.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it. Highly appreciate your Kudos!

View solution in original post

5 REPLIES 5
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

You may try this measure

Measure = 
var __values = VALUES('Fact'[region])
return
IF(SELECTEDVALUE('Dimension'[region]) IN __values, 1, 0)

vjingzhang_0-1671807265106.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it. Highly appreciate your Kudos!

MAwwad
Solution Sage
Solution Sage

Try Countx

 

Relevant Data Measure = VAR _fact_region = 'fact'[region] VAR _dim_region = 'dim'[region] RETURN IF( COUNTX( 'dim', _fact_region = _dim_region ) > 0, 1, 0 )

 

It will count the number of rows in each.

Anonymous
Not applicable

This measure has error: the function countx cannot work with values of type boolean

Try changing the data types ? or use "1" and "0" instead of 1 and 0

Anonymous
Not applicable

Thanks, I tried and it still has the same error

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.