Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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).
Solved! Go to 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.
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.
@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 -" })
)
)
)
Proud to be a Super User! |
|
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.
The result is a total of the column, but not the amount of rows without these specific text
@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 -" }
)
)
)
Proud to be a Super User! |
|
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
30 | |
13 | |
11 | |
9 | |
6 |