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
ukare1996
Helper I
Helper I

Countrows containing

Hi,

I will try and explain this in the best way possible.

I have some columns that within each row they might have different options which are semicoloun separated. 

Take for example the below coloumn - Row one contains two select options Private drains cleaned and GM UPGDARED....

within the hightlight row, I only just want to count "GM UPGRADED following....

My question is, how can I count item semicolon separted within a row? If that makes any sense

ukare1996_0-1676894321262.png

 

I have tried the below but it' not returning me the correct result

 

Monitor 1 -  TEST =
COUNTROWS(
    FILTER('Network (Test)',
    'Network (Test)'[Monitor 1 - Action] IN({"GM installed following NPO visit/advice", "GM (ADDITIONAL) installed following NPO visit/advice", "GM UPGRADED following NPO visit/advice"}
    )))
 
The above formula is only returning me 1 - not taking into account the row with multiple options separated with semicolons
Any help will be much appreciated 🙂
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@ukare1996 , try like

 

Monitor 1 - TEST =
COUNTROWS(
FILTER('Network (Test)',
Containsstring('Network (Test)'[Monitor 1 - Action] , "GM installed following NPO visit/advice")
|| Containsstring('Network (Test)'[Monitor 1 - Action] , "GM (ADDITIONAL) installed following NPO visit/advice")
|| Containsstring('Network (Test)'[Monitor 1 - Action] ,"GM UPGRADED following NPO visit/advice")
))

 

 

CONTAINSSTRING and CONTAINSSTRINGEXACT: https://www.youtube.com/watch?v=XbgLGDvWdWQ&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=44

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

2 REPLIES 2
ukare1996
Helper I
Helper I

Thank you, I honestly dont know why I didnt think of doing it this way 🙂

Much appreciated

amitchandak
Super User
Super User

@ukare1996 , try like

 

Monitor 1 - TEST =
COUNTROWS(
FILTER('Network (Test)',
Containsstring('Network (Test)'[Monitor 1 - Action] , "GM installed following NPO visit/advice")
|| Containsstring('Network (Test)'[Monitor 1 - Action] , "GM (ADDITIONAL) installed following NPO visit/advice")
|| Containsstring('Network (Test)'[Monitor 1 - Action] ,"GM UPGRADED following NPO visit/advice")
))

 

 

CONTAINSSTRING and CONTAINSSTRINGEXACT: https://www.youtube.com/watch?v=XbgLGDvWdWQ&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=44

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

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!

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.