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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
yashdsin
Frequent Visitor

Filtering specific country from list of Country

Hi,

 

I my Data i have a list of countries from which i need to filter out a specific country such as @"Spain" from destination country. What options do i have? I want to show it on a graph in comparison with all countries.Data.PNG

1 ACCEPTED SOLUTION
ivancespedesl
Helper I
Helper I

Hi,

 

You can create all your graphs as if you will use all the data. Then, go to your variable "Country", click it and switch the visualization to a "Slicer". Afterwards, go to "Format" on the top of the page and then "Edit Interactions". You can choose which graphs to filter on the dashboard. That way you can have all your data from every other country and a set of visualizations dedicated to the country selected. 

View solution in original post

7 REPLIES 7
Robo
Frequent Visitor

Here you have an example, how to do it for your database. 

Assumption: Countries are listed in one column (like that)How to create country report with charts - data.jpgHow to create country report with charts.jpg

 

Link to this public report: https://coronadatasource.org/open-reports/general/cds-corona-covid-19-all-in-one-report/

if link not working, go to https://coronadatasource.org/ and click to open reports

yashdsin
Frequent Visitor

Many thanks for your kind help.

You're welcome

ivancespedesl
Helper I
Helper I

Another option is to use Calculate('Table'[Measure], 'Table'[Country_variable] == "Spain")

ivancespedesl
Helper I
Helper I

Hi,

 

You can create all your graphs as if you will use all the data. Then, go to your variable "Country", click it and switch the visualization to a "Slicer". Afterwards, go to "Format" on the top of the page and then "Edit Interactions". You can choose which graphs to filter on the dashboard. That way you can have all your data from every other country and a set of visualizations dedicated to the country selected. 

v-juanli-msft
Community Support
Community Support

Hi @yashdsin 

Create a new table which has no relationship with other tables.

country list = VALUES(Table1[destination])

Add [destination] in a slicer.

 

Create measures in Table1

Measure = CALCULATE(MAX('country list'[destination]),USERELATIONSHIP(Table1[destination],'country list'[destination]))

Measure 2 = IF(MAX(Table1[destination])=[Measure],1,0)

Add [Measure 2] in the visual level filter, so the table would only show rows for the specific country.

7.png

Best Regards
Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Maggie,

 

Many thanks for your kind support. I am trying to incoporate your calculation on my data but receiving an error. Attached is the error could you please help me in where i am going wrong.

Error.PNG

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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