Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Countif for duplicate values

Hi,

Simple question, I suppose.

I have 2 columns.

A: unique bookingID

B: customerID for those bookings

 

In column C I would like to see how often customerID occurs from column B; often that customerID occurs 10 times or so. So on each row (for each bookingID), I would like to see in column C how often the customerID occurs. 

 

How would achieve this in Power BI? Using a custom column?

 

 

  • Anonymous ,

    new columns

    Count across booking ID

    countx(filter(table ,[Customer ID] =earlier([Customer ID])),[Customer ID])

     

    Count across within  booking ID

    countx(filter(table ,[Customer ID] =earlier([Customer ID]) && [Booking ID] =earlier([Booking ID])),[Customer ID])

1 Reply

  • Anonymous ,

    new columns

    Count across booking ID

    countx(filter(table ,[Customer ID] =earlier([Customer ID])),[Customer ID])

     

    Count across within  booking ID

    countx(filter(table ,[Customer ID] =earlier([Customer ID]) && [Booking ID] =earlier([Booking ID])),[Customer ID])