Forum Discussion
Filtering Data based on another non related field from a different Table
- 5 years ago
Hi Tanyag ,
To better understand your scenario, I have some questions:
- Are there no realtionships between the two tables?
- 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.
Hi Tanyag ,
To better understand your scenario, I have some questions:
- Are there no realtionships between the two tables?
- 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.
- Tanyag5 years agoFrequent 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