Forum Discussion
Milozebre
8 years agoHelper V
If contains function with a filter
Dear community, I need your help. I would like to filter my measure with 2 criteria First on the service which must always be "Contrat Assistance G" and on the category which must start with ...
- 8 years ago
Hi Milozebre,
Assuming that your columns always start with the values you said then use this expression:
Count dossier = CALCULATE ( DISTINCTCOUNT ( 'Table'[Dossier] ); LEFT ( 'Table'[Service]; 20 ) = "Contrat Assistance G"; LEFT ( 'Table'[Categorie]; 5 ) = "APPRO" )If the columns don't start by that text but need to have that text within the column try this one:
Count dossier = CALCULATE ( DISTINCTCOUNT ( 'Table'[Dossier] ); FIND ( "Contrat Assistance G"; 'Table'[Service]; 1; 0 ) > 0; FIND ( "APPRO"; 'Table'[Categorie]; 1; 0 ) > 0 )Regards,
MFelix
MFelix
8 years agoSuper User
Hi Milozebre,
Assuming that your columns always start with the values you said then use this expression:
Count dossier =
CALCULATE (
DISTINCTCOUNT ( 'Table'[Dossier] );
LEFT ( 'Table'[Service]; 20 ) = "Contrat Assistance G";
LEFT ( 'Table'[Categorie]; 5 ) = "APPRO"
)If the columns don't start by that text but need to have that text within the column try this one:
Count dossier =
CALCULATE (
DISTINCTCOUNT ( 'Table'[Dossier] );
FIND ( "Contrat Assistance G"; 'Table'[Service]; 1; 0 ) > 0;
FIND ( "APPRO"; 'Table'[Categorie]; 1; 0 ) > 0
)
Regards,
MFelix
- Milozebre8 years agoHelper V
Good morning MFelix,
Its working.
Thnak you very much