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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Create new column with formula

Hi All,

 

I would like to create a 3rd column in my table summarizing the number of time the value in column B is repeated based on ID column A such as the below:

IDValueResult column
ID1A3
ID1A3
ID2A1
ID3B1
ID1B2
ID1B2
ID3A2
ID3A2
ID4A1
ID1A3

As a second step, I will be able to say per ID what is the most frequent value using max formula.

Any one can help to find the right formula to create the column C in Power BI?

 

Thanks,

 

Louise

2 ACCEPTED SOLUTIONS
harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

 

Create a Calculated Column

 

ResultsColumn1 =
COUNTROWS(FILTER(ALL('Table'),'Table'[ID] = EARLIER('Table'[ID]) && 'Table'[Value] = EARLIER('Table'[Value])))
 
1.jpg
 

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

View solution in original post

amitchandak
Super User
Super User

@Anonymous , Create a new column

Result = countx(filter(table,[ID]=earlier([ID]) && [Value]=earlier([Value])),[ID])

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Create a new column

Result = countx(filter(table,[ID]=earlier([ID]) && [Value]=earlier([Value])),[ID])

harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

 

Create a Calculated Column

 

ResultsColumn1 =
COUNTROWS(FILTER(ALL('Table'),'Table'[ID] = EARLIER('Table'[ID]) && 'Table'[Value] = EARLIER('Table'[Value])))
 
1.jpg
 

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.