cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gheecalipes25
Frequent Visitor

how to create a column getting the unique count of another column

Hi,

 

I am trying to create a column that would distinguish if the values of Column A has 1 or more occurences. like for example i have a column for Requestnumber&Region, and i would like to create a column that would determine if a specific rowdata has multiple instances. I would want to achieve the value below:

 

 

Column AGenerated Column
29845Americas1
29845Americas0
29845EMEA1
29845EMEA0
29845LA1
29845LA0
  

 

1 ACCEPTED SOLUTION
jppv20
Solution Sage
Solution Sage

Hi @gheecalipes25 ,

 

I'm not sure if I completely understand you question but you could try this:

Go to the Power Query Editor and add an Index Column:

jppv20_0-1635407205894.png

 

Then create this column:

Generated Column =
var Count_A = CALCULATE(COUNT('Table'[Column A]),ALLEXCEPT('Table','Table'[Column A]),'Table'[Index]>EARLIER('Table'[Index]))
Return
IF(Count_A=BLANK(),0,Count_A)
 
Result:
jppv20_1-1635407237203.png

 

If I answered your question, please mark it as a solution to help other members find it more quickly.

 

View solution in original post

2 REPLIES 2
gheecalipes25
Frequent Visitor

Thank you. it worked perfectly. 🙂

jppv20
Solution Sage
Solution Sage

Hi @gheecalipes25 ,

 

I'm not sure if I completely understand you question but you could try this:

Go to the Power Query Editor and add an Index Column:

jppv20_0-1635407205894.png

 

Then create this column:

Generated Column =
var Count_A = CALCULATE(COUNT('Table'[Column A]),ALLEXCEPT('Table','Table'[Column A]),'Table'[Index]>EARLIER('Table'[Index]))
Return
IF(Count_A=BLANK(),0,Count_A)
 
Result:
jppv20_1-1635407237203.png

 

If I answered your question, please mark it as a solution to help other members find it more quickly.

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.