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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
MickeLearnPBI
Helper I
Helper I

Need help to count unique values

Hi!

 

I need help to calculate the unique number of people working only on one type of BusinessUnits, but sometimes staff work on the same type of Unit but in different departments.


For example
Sarah works in Sales in two departments and Jenni also works in Sales but in one department. In total I have four staff but in the results when I filter on Sales BusinessUnit I only want to get 2 in the results, because only Sarah and Jenni work in Sales, and not in any other Unit.

Is it possible?

 

Table

PersonIDFirstNameLastNameBusinessUnitDepartment
556677MattOlsenSalesDepartment 1
556677MattOlsenProductionDepartment 1
775566JenniGrantSalesDepartment 1
445566DanielLaRussoConsultantDepartment 1
994455SarahConnorSalesDepartment 1
994455SarahConnorSalesDepartment 2

 

1 ACCEPTED SOLUTION

ray_aramburo_0-1713278438614.png

There you go 🙂





Did I answer your question? Give your kudos and mark my post as a solution!

Proud to be a Super User!





View solution in original post

8 REPLIES 8
Ahmedx
Super User
Super User

why can’t we count Matt, he works in the sales department?

556677 Matt Olsen Sales Department 1

Matt also works on another Unit, i only want to show the result of people working on one type of unit.

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Screenshot_2.pngScreenshot_3.png

ray_aramburo
Super User
Super User

I would recommend you to create a new column to differentiate that by concatenating PersonID with Business Unit. Then create a measure to distinct count this new column (Measure = DISTINCTCOUNT([ColumnName]). Then create a visual and add only the Person ID and then the Measure. You can know use the filter pane to filter the visual for Measure is 1. 





Did I answer your question? Give your kudos and mark my post as a solution!

Proud to be a Super User!





Could you elaborate further or show me how to do it?

Find attached what I meant. Feel free to explore the file and the Power Query. 





Did I answer your question? Give your kudos and mark my post as a solution!

Proud to be a Super User!





This is amazing! Thank you!
Is it possible to get the result of 3 to show on a card?

ray_aramburo_0-1713278438614.png

There you go 🙂





Did I answer your question? Give your kudos and mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.