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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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])))


Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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