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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
gheecalipes25
Helper II
Helper II

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
Helper II
Helper II

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.

 

Helpful resources

Announcements
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.