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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Measure to get distinct countries from column holding a list of countries for each row

Hi,
Could someone help with the below scenario:
I have a table similar to below which holds a list of countries for each row:

IDGroupCountry
1011AINDIA;CHINA
1038AINDIA;CHINA;ENGLAND;SRILANKA
5052BSWEDEN;FINLAND
3033CSRILANKA
9800BSWEDEN;NORWAY
6500BNORWAY;FINLAND

 

Now I need to create a measure that gives me the distinct country based on the filters applied for 'ID' or 'Group' columns.

For example, if i apply the filter "Group = B", it should consider the 3 rows for group B and measure should give me the distinct  count as 3. It will get the 3 distinct countries from the combination of those 3 rows (SWEDEN,NORWAY,FINLAND)

Could you please help me here.
In the real scenario the list is much longer.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,

 

Below are the results as expected..

Firstly ., Need to Split the country column with a delimiter in power query editor.

 

Subash_Govind1_1-1700823369330.png

Then create a measure..

Subash_Govind1_0-1700822145649.png

View solution in original post

4 REPLIES 4
Rupak_bi
Super User
Super User

Hi , Please see below

 

Rupak_bi_1-1700889521541.png

 

if you are looking for this then follow @Anonymous answer.

 



Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/
Rupak_bi
Super User
Super User

Is this something you are looking for?

 

Rupak_bi_0-1700820162944.png

 

 

 



Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/
Anonymous
Not applicable

Thanks.
But I want to get the distinct count of the countries from the column 'Country' for the selected filters.
It has to be "3" when Group B is selected (SWEDEN,NORWAY,FINLAND) ,
"4"  for Group A (INDIA, CHINA, ENGLAND, SRILANKA)
and "1" for Group C (Only SRILANKA).

Anonymous
Not applicable

Hi,

 

Below are the results as expected..

Firstly ., Need to Split the country column with a delimiter in power query editor.

 

Subash_Govind1_1-1700823369330.png

Then create a measure..

Subash_Govind1_0-1700822145649.png

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.