Forum Discussion
AlejandroPCar
8 years agoHelper IV
External filters does not affect ALLEXCEPT
Hi, I have a measure with ALLEXCEPT that allows me count the number of companies in a sector. In the first table there are 18 companies in that sector so the count works. But in the same sector...
- 8 years ago
you are giving column name in ALLSELECTED whereas it need to be only Table Name
ALLSELECTED( 'Tabla Cruce')
AlejandroPCar
8 years agoHelper IV
Hi parry2k
That does not works.
parry2k
8 years agoSuper User
i just tested at your pbix and it worked
can you share what changed you made to your measure
- AlejandroPCar8 years agoHelper IV
Hi parry2k
Where exactly did you the change? I replace all the ALLEXCEPT in the masure with ALLSELECTED but the result is this:
But I need the total ( i.e. 18 ) for every row. Thats your result too?
- parry2k8 years agoSuper User
can you share your measure
it has to be allselected(tablename), not any column in it.
- AlejandroPCar8 years agoHelper IV
Hi, parry2k
Here is it
MEASURE TEST = VAR ClaseS = CALCULATE( [Número de Empresas], ALLSELECTED( 'Tabla Cruce'[CIIUEmpresa] ) ) VAR GrupoSu = CALCULATE( [Número de Empresas], ALLSELECTED( 'Tabla Cruce'[GRUPOEmpresa] ) ) VAR DivisionS = CALCULATE( [Número de Empresas], ALLSELECTED( 'Tabla Cruce'[DIVISIONEmpresa] ) ) VAR SeccionS = CALCULATE( [Número de Empresas], ALLSELECTED( 'Tabla Cruce'[SECCIONEmpresa] ) ) RETURN IF( [Número de Empresas] = 0, BLANK(), SWITCH( TRUE, SUM( 'Tabla Sectores'[id_Sector] ) = 1, ClaseS, SUM ('Tabla Sectores'[id_Sector] ) = 2, GrupoSu, SUM ('Tabla Sectores'[id_Sector] ) = 3, DivisionS, SUM ('Tabla Sectores'[id_Sector] ) = 4, SeccionS ) )