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
Tanyag
Frequent Visitor

Filtering Data based on another non related field from a different Table

I have two tables and oen is 

Tanyag_0-1626377340944.png

and another is 

Tanyag_1-1626377399980.png

I can select the distance using ZIP code and show  the Zip Codes within the selected radious . My issues is I would like to see the data from second table based on Zip Code within that radius.  The Second Table is using direct query and cannot use API function Is there a workaround for this using a DAX/PowerQuery 

Tanyag_2-1626377550260.png

 

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Tanyag ,

 

To better understand your scenario, I have some questions:

 

  1. Are there no realtionships between the two tables?
  2.  Which fields do you use for the slicers of "Zip" and "Maximum Distance (km)"?

 

If there are no relationships between the two tables and the "Zip" slicer is based on 'Table1'[zip code], the "Maximum Distance (km)" is based on a What-if parameter, try to create a measure like below and set it as "is 1" when using it as a visual level filter.

 

Measure =
VAR SelectedZip =
    SELECTEDVALUE ( 'Table1'[zip code] )
VAR SelectedRadious = [Maximum Distance (km)]
RETURN
    IF (
        MAX ( 'Table2'[zip] ) = SelectedZip
            && MAX ( 'Table2'[DistanceMI] ) <= SelectedRadious,
        1
    )

 

If this doesn't meet your requirements, please show me more details.

 

 

Best Regards,

Icey

 

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

View solution in original post

2 REPLIES 2
Icey
Community Support
Community Support

Hi @Tanyag ,

 

To better understand your scenario, I have some questions:

 

  1. Are there no realtionships between the two tables?
  2.  Which fields do you use for the slicers of "Zip" and "Maximum Distance (km)"?

 

If there are no relationships between the two tables and the "Zip" slicer is based on 'Table1'[zip code], the "Maximum Distance (km)" is based on a What-if parameter, try to create a measure like below and set it as "is 1" when using it as a visual level filter.

 

Measure =
VAR SelectedZip =
    SELECTEDVALUE ( 'Table1'[zip code] )
VAR SelectedRadious = [Maximum Distance (km)]
RETURN
    IF (
        MAX ( 'Table2'[zip] ) = SelectedZip
            && MAX ( 'Table2'[DistanceMI] ) <= SelectedRadious,
        1
    )

 

If this doesn't meet your requirements, please show me more details.

 

 

Best Regards,

Icey

 

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

Tanyag
Frequent Visitor

Thanks Icey

(sorry for delayed response I was on a walk)

As Far as relationship goes the common key field is ZIP code 

The Zip I used is global city data (Open Source) It eventually is working

Tanyag_0-1627932641432.png

 

 

 

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.