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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Count how many times my reference number appears on a row

Hi there,

 

I am looking for help/ solution to display how many times each booking reference appears in my POWERBI query/ table. I want the function to count how many times the booking reference appear in the query and put the number of appearance against each row  (as shown below) so that I can track them and cross check that they are working. 

Is this possible ? Please help. 

 

Capture.JPGCapture2.JPG

8 REPLIES 8
Anonymous
Not applicable

Hey @Anonymous 

Use the following DAX

Count =
COUNTROWS (
    FILTER ( Table, Table[Booking_Reference] = EARLIER ( [Booking_Reference] ) )
)

Good Luck!

Anonymous
Not applicable

OMG! Thank you so so so much ! 

 

I was wondering if you can help me with one more enquiry. Is there a formula where we can count each time the booking reference occured as shown below. We are planning to use the count number 1 for further calculations.  Please help. 

 

 Capture3.JPG

Anonymous
Not applicable


I was wondering if you can help me with one more enquiry. Is there a formula where we can count each time the booking reference occured as shown below. We are planning to use the count number 1 for further calculations.  Please help. 

 

 Capture3.JPG


Hey @Anonymous 

Here you go. A step-by-step tutorial to achieve what you want.

Good Luck!
A

Anonymous
Not applicable

Hi mate, 

 

Thanks again. 

 

This did not work for us. I think we got stuck with the DAX during the measure. Would you mind suggesting another solution? The DAX is not picking up the correct fields we were after. 

 

We created the Index Column from the Query; then we went to actual table and created a Calculated column using a measure. While we were trying to define the measure, we were not successful. 

Anonymous
Not applicable

@Anonymous 

Please share a sample of your data and/or your PBIX file.

Thanks,
A

Hi,

Will you be OK with a solution in the M language?  Also, instead of xx, shouldn't the answer be 1?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi Ashish,

 

thanks for your email. Do you mean Measure by M language? 

 

Yes - XX should be 1. I just wanted to emphasize the the first booking reference.

 

Thanks, 

 

ARIF 

Hi,

"M" (short for Mashup) is the coding language of the Query Editor whereas measures are written in the DAX language.  So my question is whether you would be OK with a solution in the M language?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.