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 August 31st. Request your voucher.

Reply
Rza_o
New Member

How to filter data using two slicers

Hi,

 

I have three tables: `origin`, `destination`, and `all_local` table which has the geo data points for all the the (unique) locations. Based on the user's selection, I'd like to visualize  these data points on the Map visual. As shown in the following graph.

 

Untitled Diagram.drawio.png

 

I've set up two single select slicers for the origin and destination table. If the user selects both origin and destination, the data point for these two locations should be filtered from the  `all_local` table and display the datapoint for these two locations on the map visual. Otherwise, all the locations in the `all_local` table should be displayed on the map. 

 

 

I tried a couple of methods including the following code, but with no luck. I'd appreciate any suggestions.

 

 

 

 

 

 

 

filtered_table = (

    var org = SELECTEDVALUE('origin'[name])
    var dest = SELECTEDVALUE('destination'[name])
    return Filter(all_local, all_local[name] = org || all_local[name] = dest)

)

 

 

 

 

 

 

Dummy Data

Table: Origin

Columns: name, val

 

Brethren1
White Pine1
Westphalia1
Holt1
Frontier1
Bay Shore1
Cutlerville1
Zilwaukee1
Eckerman1
Old Bridge1
Somers Point1
Franklinville1
Allamuchy1
Laurel Springs1
West Belmar1
Pomona1

 

 

Table: Destination

Columns: name, value

Avon-by-the-Sea2
Columbia2
Singac2
Ralston2
Bayonne2
Ridgefield Park2
Towaco2
Sewell2
Navesink2
Lake Pine2
Mercury2
Dunphy2
Spanish Springs2
Schurz2
Round Mountain2
Fernley2

 

Table: all_local

Columns: name,State,Lat,Long,Flu cases reported

BrethrenMichigan44.2989-86.0185184.7
White PineMichigan46.7402-89.5812235.1
WestphaliaMichigan42.9303-84.798328
HoltMichigan42.6416-84.53071086
FrontierMichigan41.7817-84.6047101.6
Bay ShoreMichigan45.3609-85.1117163.9
CutlervilleMichigan42.8406-85.67391246.4
ZilwaukeeMichigan43.4809-83.9223271
EckermanMichigan46.3653-85.035429.7
Old BridgeNew Jersey40.3946-74.3323785.9
Somers PointNew Jersey39.3167-74.60661008
FranklinvilleNew Jersey39.6182-75.0757322.8
AllamuchyNew Jersey40.9222-74.8116134.2
Laurel SpringsNew Jersey39.8213-75.00531613
West BelmarNew Jersey40.1707-74.03762403.7
PomonaNew Jersey39.4687-74.5501198.1
Avon-by-the-SeaNew Jersey40.1914-74.01621627
ColumbiaNew Jersey40.926-75.0945360.9
SingacNew Jersey40.8849-74.2432523.9
RalstonNew Jersey40.7712-74.6252164.9
BayonneNew Jersey40.6659-74.11414456
Ridgefield ParkNew Jersey40.8543-74.02012979
TowacoNew Jersey40.922-74.3454582.8
SewellNew Jersey39.7665-75.1443968.2
NavesinkNew Jersey40.4021-74.0387208.5
Lake PineNew Jersey39.8659-74.8493900
MercuryNevada36.6605-115.99450
DunphyNevada40.7088-116.53010
Spanish SpringsNevada39.6567-119.6695445
SchurzNevada38.9366-118.792519.5
Round MountainNevada38.711-117.067617.8
FernleyNevada39.5612-119.192562
3 REPLIES 3
Anonymous
Not applicable

HI @Rza_o,

Did these tables and filter link to the same geo field? If that is the case, current power bi will use AND logic to link different filter effect. So if you select item on different filters, they will be filtering records which match all the filter items.

If these filter conditions are contradictory, it will affect the visualization and no data displayed because not existed records match all conditions at the same time.

For this scenario, you may need to break the relationship and directly extract these selections to use Dax expression to calculations.

Regards,

Xiaoxin Sheng

Mahesh0016
Super User
Super User

@Rza_o 
Please Share Your Dummy Data or ENDOUTPUT!THANK YOU!!

I updated my post. It didn't allow me to upload the files so I had to use html tables 😕

 

Thank you

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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