cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ale
Advocate I
Advocate I

1 single common Slicer to filter 2 different "Country columns" in the dataset (in different visuals)

My problem is the following:

 

I have a dataset where I have 2 country Columns: CountryOfOrigin and CountryOfDestination.

 

I built 2 visuals (tables) to display all product being shipped TO and FROM the selected country.

 

The first visual worked fine, when I simply used the CountryOfDestination as Slicer, and in the table I used the CountryOfOrigin as dimension.

 

However, the second visual does not work, as the slicer is slicing the CountryOfDdestination, and here I would need it to slice the CountryOfOrigin.

 

I made a quick Excel representation of what my data looks like, and what is the output I want: https://i.postimg.cc/hPQhQTf4/Country-Issue.png

 

CountryIssue.PNG

 

 

 

 

 

 

 

 

Bottomline is: how do I make a common slicer that would filter 2 different columns?

1 ACCEPTED SOLUTION
Ale
Advocate I
Advocate I

Hi Robert,

 

thanks for your reply. Interesting, I just learned something I didn't know! However, it was not exactly what I was looking for. I think I did not make myself clear, but I ended up finding a solution myself.

 

What I did was:

Created a table with the list of countries and used it as a Slicer.

 

Then I created 2 inactive relationships, one to CountryOfOrigin and one to CountryOfDestination.

 

In the measure, I used the USERELATIONSHIP() to activate the relationship between them on the fly. With that I simply created my 2 visuals using the respective measures.

 

Thanks again for your reply.

View solution in original post

3 REPLIES 3
Ale
Advocate I
Advocate I

Hi Robert,

 

thanks for your reply. Interesting, I just learned something I didn't know! However, it was not exactly what I was looking for. I think I did not make myself clear, but I ended up finding a solution myself.

 

What I did was:

Created a table with the list of countries and used it as a Slicer.

 

Then I created 2 inactive relationships, one to CountryOfOrigin and one to CountryOfDestination.

 

In the measure, I used the USERELATIONSHIP() to activate the relationship between them on the fly. With that I simply created my 2 visuals using the respective measures.

 

Thanks again for your reply.

Hi, @Ale 

Glad to hear that you have solved the problem by yourself, would you like to mark your own reply as a solution so that others can learn from it too?

Thanks in advance!

 

Best Regards,

Community Support Team _Robert Qin

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

v-robertq-msft
Community Support
Community Support

Hi, @Ale 

According to your description, I guess you want to create a Slicer that slices the column [CountryOfDestination] and [CountryOfOrigin] at the same time. If you want to achieve this, you can just try to place these two columns in one slicer, then you can slice them at the same time, like this:

v-robertq-msft_0-1607583613948.png

 

More info about Slicer in Power BI

You can download my test pbix file here

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

 

Best Regards,

Community Support Team _Robert Qin

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

Helpful resources

Announcements
August 2022 update 768x460.jpg

Check it Out!

Click here to learn more about the August 2022 updates!

August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors