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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Jgrohows
Frequent Visitor

Summarize and visualize distinct count on multiple columns

Hello!

 

I am struggling to figure out a way to summarize and visualise an ask that involves determining distinct counts on multiple columns. Lets say i have a list of Employee #, Country and City and my ultimate goal is to identify how many employees traveled to 1 county, 2 counties, 3, 4 and onwards (for this example lets say there are 5 countries). 

 

Emplyee #CountryCity
1FranceParis
1GermanyBerlin
1ItalyMilan
1ItalyRome
1PolandWarsaw
1GreeceAthens
2FranceParis
2Germany Berlin
2Germany Munich
2GreeceAthens
3GermanyBerlin
3ItalyMilan
3ItalyRome
3GreeceAthens
4ItalyMilan

 

In the example table above, the result would be :

Traveled to 1 country - 1 (employee 4)

Traveld to 2 countries -  0 

Traveled to 3 countries - 2 (employee  2 & 3)

Traveled to 4 countries - 0 

Traveled to 5 countries - 1 (employee 1)

 

I then want to be able to create a visual that would look something like this

 

Jgrohows_2-1674684894017.png

 

 

I am struggling to figure out the correct measures to develop in order to capturing this informaiton and visualze. Any help you have would be greatly appreciated.

 

Thank you!

1 ACCEPTED SOLUTION
onurbmiguel_
Power Participant
Power Participant

hello Jgrohows

Is this the output wanted ?

 

onurbmiguel__0-1674685169600.png

I creat one column and one mesure: 

 

No of countries = 
-- Column 
var _name = 'Table'[Name]

var _value = 
    CALCULATE(
        DISTINCTCOUNT('Table'[Country]),
        ALL('Table'),'Table'[Name] = _Name
    )

return 
_value

 

Total of persons = 
-- Measure 
DISTINCTCOUNT('Table'[Name])

 

check the solution in this LINK

 

Best regards

Bruno Costa | Solution Supplier

 

Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 👍

Take a look at the blog: PBI Portugal 

 

wp-1586527108426

 


Best regards


Bruno Costa | Super User


 


Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 


Take a look at the blog: PBI Portugal 


 


View solution in original post

1 REPLY 1
onurbmiguel_
Power Participant
Power Participant

hello Jgrohows

Is this the output wanted ?

 

onurbmiguel__0-1674685169600.png

I creat one column and one mesure: 

 

No of countries = 
-- Column 
var _name = 'Table'[Name]

var _value = 
    CALCULATE(
        DISTINCTCOUNT('Table'[Country]),
        ALL('Table'),'Table'[Name] = _Name
    )

return 
_value

 

Total of persons = 
-- Measure 
DISTINCTCOUNT('Table'[Name])

 

check the solution in this LINK

 

Best regards

Bruno Costa | Solution Supplier

 

Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 👍

Take a look at the blog: PBI Portugal 

 

wp-1586527108426

 


Best regards


Bruno Costa | Super User


 


Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 


Take a look at the blog: PBI Portugal 


 


Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.