Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

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

  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi Anonymous ,

     

     

    Create a Calculated Column

     

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

    Regards,
    Harsh Nathani

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

  • Anonymous , Create a new column

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

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

     

    Create a Calculated Column

     

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

    Regards,
    Harsh Nathani

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

  • Anonymous , Create a new column

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