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
Anonymous
Not applicable

Excel Formula or Power Query

Is there any way to figure out a formula on the below :

I need the last column with a formula that could count as per the docket number how many people has worked on that docket. The last column will count and return a value accordingly.

If there are three dockets open with same number, and one person has worked on it - it will return value 1. The below is an example

I have attached both picture and a table below to understand it clearly.

 

NameDocket OpenNumber of Times Docket AppearsNo. of Person on Same Docket
   Example
   Need a formula to count this column
NameDocket NumberCOUNT DOCKETCOUNT TECHNICIAN
Mr.XBC37540011
Mr.YBC37547133
Mr.XBC37547133
Mr.ZBC37547133
Mr.ABC37548132
Mr.ABC37548132
Mr.BBC37548132
Mr.CBC37549531
Mr.CBC37549531
Mr.CBC37549531

 

Capture.PNG

1 ACCEPTED SOLUTION
samdthompson
Memorable Member
Memorable Member

Hi,

 

1. group by on docket number - use the advanced grouping.

2. distinct count on rows and then expand:

2020-09-09_8-46-19.jpg2020-09-09_8-46-34.jpg2020-09-09_8-46-48.jpg

 

 

 

// if this is an answer please mark as such, kudos always appreciated.

// if this is a solution please mark as such. Kudos always appreciated.

View solution in original post

4 REPLIES 4
v-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

 

Have you resolved it? If yes, please accept the helpful answers as solutions. Others will benefit from this thread. Thanks!! If you still need help, please feel free to ask us.

 

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
CNENFRNL
Community Champion
Community Champion

Aha, formula, my good old ones ...😉

Hi, @Anonymous , since PQ and DAX solutions are already provided, pls refer to formula solution as follows,

 

COUNT DOCKET =COUNTIF(DS[Docket Number],DS[@[Docket Number]])

//Array formula, Ctrl+Shift+Enter to enter
COUNT TECHNICIAN {=COUNT(0/FREQUENCY(IFERROR(MATCH(IF(DS[Docket Number]=DS[@[Docket Number]],DS[Name]),DS[Name],),""),ROW(DS[Name])-ROW(DS[[#Headers],[Name]])))}

 

 

 first things first, convert the dataset range into a table (hotkey: Ctr+T) named "DS".

Formula.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

samdthompson
Memorable Member
Memorable Member

Hi,

 

1. group by on docket number - use the advanced grouping.

2. distinct count on rows and then expand:

2020-09-09_8-46-19.jpg2020-09-09_8-46-34.jpg2020-09-09_8-46-48.jpg

 

 

 

// if this is an answer please mark as such, kudos always appreciated.

// if this is a solution please mark as such. Kudos always appreciated.
Greg_Deckler
Super User
Super User

@Anonymous - Maybe:

Count Technician (Column) =
  VAR __Table = FILTER('Table',[Docket Number]=EARLIER([Docket Number]))
RETURN
  COUNTROWS(DISTINCT(SELECTCOLUMNS(__Table,"Name",[Name])))

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.

Top Solution Authors
Top Kudoed Authors