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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
randyvdr
Frequent Visitor

Count repeated values and return count

Hello Power Bi Community,

 

Would you please help me creating a measurement that count the number of repeated record ID and returns that number in each of the rows of the same record ID.

 

The following is the table data

randyvdr_0-1679958542377.png

and the following is the how the result should look like:

randyvdr_1-1679958624077.png

the result above result comes from creating new column by the following formula:

Count of RCA = COUNTX(FILTER('incident',EARLIER('incident'[Record job ID])='incident'[Record job ID]),[Record job ID])
 
But i am wondering if i can do it with a measure instead of a column to improve model efficiency.
 
Final goal of the requested measurement is to divide the count of RCA by total Non productive time to assign equitative non productive time for each row. something like this:
 
randyvdr_2-1679958852505.png

where: 

aditional new column ->>   Weighted NPT = DIVIDE([Total Non productive time],[Count of RCA])

 

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@randyvdr 

you can try this to create a measure

Measure = if(HASONEVALUE('Table'[Record job ID]),CALCULATE(count('Table'[Record job ID]),FILTER(all('Table'),'Table'[Record job ID]=max('Table'[Record job ID]))))

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
ryan_mayu
Super User
Super User

@randyvdr 

you can try this to create a measure

Measure = if(HASONEVALUE('Table'[Record job ID]),CALCULATE(count('Table'[Record job ID]),FILTER(all('Table'),'Table'[Record job ID]=max('Table'[Record job ID]))))

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors