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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Add Count Column

I need to create a new column where I can get the Count of reservationId per clientId.
I have reservationId and clientId, reservationId is distinct.

patilmeet7_0-1634179394080.png

I create a table to get count of reservationId per ClientId below:

patilmeet7_1-1634179557056.png

Similarly I need that count in column.

 



1 ACCEPTED SOLUTION

Hi @Anonymous 

 

It should be 

T.Count = COUNTX (FILTER ( 'public Reservations', [clientId] = EARLIER ( [clientId] ) ),[reservationId])

 

Take care of pairs of parentheses. One ")" in your DAX formula just isn't at the correct position.  

 

Best Regards,
Community Support Team _ Jing

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@Anonymous , a new column

countx(filter(Table, [clientid] =earlier([clientid]) ,[reservationid])

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Its giving Unexpected Parameter.

patilmeet7_1-1634184041610.png

Furthermore, I am trying to get the column via Power Query Editor. @amitchandak 

Hi @Anonymous 

 

It should be 

T.Count = COUNTX (FILTER ( 'public Reservations', [clientId] = EARLIER ( [clientId] ) ),[reservationId])

 

Take care of pairs of parentheses. One ")" in your DAX formula just isn't at the correct position.  

 

Best Regards,
Community Support Team _ Jing

@Anonymous , this was dax, one correct

 

countx(filter(Table, [clientid] =earlier([clientid])) ,[reservationid])

 

for power query create a new table that group by client id and merge that with this table 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak I was able to use the group by and accomplish what I needed to do.

While for the DAX you provided, it is still showing Unexpected Parameter so that isn't working over here.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.