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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
abc_777
Super User
Super User

how to count values starts with RR

hi,

 

I have table data like

 

Customer ID

1045

2014

3056

RR34544

RR34565

RR57585

RR89999

 etc

 

I have done advansed filter and begin with RR so I get

 

Customer ID

RR34544

RR34565

 

now I want to count these values starts with RR

 

3 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@abc_777 , a new measure 

countrows(Filter(Table, left(Table[Customer ID],2) = "RR"))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

I have tried follwoing two two formulas but not giving me correct result.

if see the jpeg image i attached its not counting correctly. I have values two time but it counting one

 

CR Count = COUNTROWS(

    FILTER(Table, left(Column,2) = "CR"))

 

 

Count of CR=

CALCULATE(

    COUNTROWS(Table),

    LEFT(column,2)

        IN { "CR" }

)

 

3.JPG

 

See the difference

 

4.JPG

View solution in original post

Anonymous
Not applicable

Hi @abc_777 ,

 

Please follow these steps:

 

1. Set a flag to specify rows which starts with RR

Filter RR = IF(LEFT(MAX('Table'[Customer ID]),2)="RR",1)

2. Apply the measure to filter pane like this: 

 

Filter start with RR.PNG

3. Count the number of eligible rows:

Count = SUMX('Table',[Filter RR])

The final output is shown below:

count start with rr.PNG

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

Hi @abc_777 ,

 

Please follow these steps:

 

1. Set a flag to specify rows which starts with RR

Filter RR = IF(LEFT(MAX('Table'[Customer ID]),2)="RR",1)

2. Apply the measure to filter pane like this: 

 

Filter start with RR.PNG

3. Count the number of eligible rows:

Count = SUMX('Table',[Filter RR])

The final output is shown below:

count start with rr.PNG

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@Anonymous and @amitchandak 

 

thanks

 

 

 

 

amitchandak
Super User
Super User

@abc_777 , a new measure 

countrows(Filter(Table, left(Table[Customer ID],2) = "RR"))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak ,

 

I have tried your solution. BUt something I have made mistake. In matrix the actual count is 3 but it shows 8 in KPI(there I give the formaula). Please have a look and advise

 

2.jpg1.jpg

tried many ways but its not counting correctly

any solution? 

@Anonymous,

 

would you be able to give me the solution on this issue please

I have tried follwoing two two formulas but not giving me correct result.

if see the jpeg image i attached its not counting correctly. I have values two time but it counting one

 

CR Count = COUNTROWS(

    FILTER(Table, left(Column,2) = "CR"))

 

 

Count of CR=

CALCULATE(

    COUNTROWS(Table),

    LEFT(column,2)

        IN { "CR" }

)

 

3.JPG

 

See the difference

 

4.JPG

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors