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
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors