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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
JiriS
Helper I
Helper I

How to get most often value for person

Hi,

I create a Power BI visualisation. 

 

I need to create this from my dataset: 

Dataset Power BI.PNG

 

The Most often department for name is the most often value that has that value of department for name. It means:

John - 3* D1, 1* D2, 1* D3 so the most often value of department is D1

George - 2* D2, 1* D3 so the most often value of department is D2

Jack - 1* D1 so the most often value of department is D1

 

How to do it?

 

Thank you for your ideas.

George

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@JiriS , All three as new columns

Dept Count = 
countx(filter(table,[name] =earlier[Name] && [Department]=earlier([department)),[Department])

Dept Rank = rankx(filter(table,[name] =earlier[Name] ), [Dept Count],,desc,dense)

new Dept = maxx(filter(table,[name] =earlier[Name] && [Dept Rank] =1),[Department])

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@JiriS , All three as new columns

Dept Count = 
countx(filter(table,[name] =earlier[Name] && [Department]=earlier([department)),[Department])

Dept Rank = rankx(filter(table,[name] =earlier[Name] ), [Dept Count],,desc,dense)

new Dept = maxx(filter(table,[name] =earlier[Name] && [Dept Rank] =1),[Department])

It works. Thank you!!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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