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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Marinus
Helper I
Helper I

Countrows without selection

I have a command to countrows with a specific tekst :

CALCULATE(
COUNTROWS('Overzicht aanvragen'),
'Overzicht aanvragen'[Aanvraag_Routelint] IN { "Zvg -", "Vlgr -", "Rsdg -", "Odzg -", "Edng -", "Bdlg -", "Svgg -" }
)

 

Can someone tell me how i can countrows without this specific tekst.

I can't find any DAX code that explains how to do this (i coultn't find the "IN" code too).

1 ACCEPTED SOLUTION

Hi @Marinus,

Thanks for your update.

 

I’ve reproduced your scenario using sample data matching your raw data structure and achieved the expected output. Create the fallowing dax measure to calculate countrows.

 

rows = CALCULATE(
COUNTROWS(
FILTER(ALL('table'),
NOT('table'[Aanvraag_Routelint] IN { "Zvg -", "Vlgr -", "Rsdg -", "Odzg -", "Edng -", "Bdlg -", "Svgg -" })
)
)
)

The .pbix file attached demonstrates this working solution with your sample data.

 

If this information is helpful, please “Accept it as a solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.

View solution in original post

7 REPLIES 7
v-ssriganesh
Community Support
Community Support

Hello @Marinus,
Thank you for reaching out to the Microsoft Fabric Forum Community.

 

Please try the following DAX measure. I assume that your column contains additional text after the "-" character.

CALCULATE(
    COUNTROWS('Overzicht aanvragen'),
    FILTER(
        'Overzicht aanvragen',
        NOT (
            LEFT('Overzicht aanvragen'[Aanvraag_Routelint], SEARCH(" -", 'Overzicht aanvragen'[Aanvraag_Routelint] & " -") - 1) 
            IN { "Zvg", "Vlgr", "Rsdg", "Odzg", "Edng", "Bdlg", "Svgg" }
        )
    )
)

 

If the issue persists, kindly share a sample dataset along with the expected output. This will help in better understanding the problem and finding an appropriate solution.

 

If you find this information helpful, please consider "Accepting it as a solution" and giving it a "kudos" to assist other community members facing similar challenges.

 

Thank you.

I have deleted the dashes to make it clearer.

I have a command to countrows with a specific tekst :

CALCULATE(
COUNTROWS('Overzicht aanvragen'),
'Overzicht aanvragen'[Aanvraag_Routelint] IN { "Zvg", "Vlgr", "Rsdg", "Odzg", "Edng", "Bdlg", "Svgg" }
)

This way i count only the rows with these texts in it, but now i want to count the rows without these specific texts in it.

Hi @Marinus,

Thanks for your update.

 

I’ve reproduced your scenario using sample data matching your raw data structure and achieved the expected output. Create the fallowing dax measure to calculate countrows.

 

rows = CALCULATE(
COUNTROWS(
FILTER(ALL('table'),
NOT('table'[Aanvraag_Routelint] IN { "Zvg -", "Vlgr -", "Rsdg -", "Odzg -", "Edng -", "Bdlg -", "Svgg -" })
)
)
)

The .pbix file attached demonstrates this working solution with your sample data.

 

If this information is helpful, please “Accept it as a solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.

bhanu_gautam
Super User
Super User

@Marinus Have you tried NOT and IN

dax
CALCULATE(
COUNTROWS(
FILTER(
'Overzicht aanvragen',
NOT('Overzicht aanvragen'[Aanvraag_Routelint] IN { "Zvg -", "Vlgr -", "Rsdg -", "Odzg -", "Edng -", "Bdlg -", "Svgg -" })
)
)
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






This gives still a total of rows in the column, it includes the rows with the selected text.

It should count the rows without the rows with the selected text.

Marinus
Helper I
Helper I

The result is a total of the column, but not the amount of rows without these specific text

bhanu_gautam
Super User
Super User

@Marinus , Try using

DAX
CALCULATE(
COUNTROWS('Overzicht aanvragen'),
EXCEPT(
ALL('Overzicht aanvragen'),
FILTER(
'Overzicht aanvragen',
'Overzicht aanvragen'[Aanvraag_Routelint] IN { "Zvg -", "Vlgr -", "Rsdg -", "Odzg -", "Edng -", "Bdlg -", "Svgg -" }
)
)
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.