cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tatac1412
Helper I
Helper I

Ayuda en error La expresión hace referencia a varias columnas. No se pueden convertir varias columna

 Buenos días,
 
Me ayudan por favor con esta médida me sale el error "La expresión hace referencia a varias columnas. No se pueden convertir varias columnas a un valor escalar" porfa me ayudas Gracias
 
ProporHemoSev<18 =
Var var31=filter('EHC','EHC'[V31EsquemaTratamientoActual] IN {"1","2","4"})
Var Numerador1 = if( NOT ISEMPTY (var31), countx('EHC', var31),"")
var Numerador = if( NOT ISEMPTY (var31),count('EHC'[AñoCorte]) - Numerador1,"")
var denominador= count('EHC'[AñoCorte])
Var ProporHemosev =  if( NOT ISEMPTY (var31),divide( Numerador,denominador*100),"")
return ProporHemosev
1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @tatac1412 ,

 

You should modified this code: countx('EHC', var31)

Both EHC and var31 are tables, thus you can't make this measure work.

Based on your description, I have created a simple sample:

vjianbolimsft_0-1672714374390.png

Please try something like this:

 

ProporHemoSev<18 = 
Var var31=filter('EHC','EHC'[V31EsquemaTratamientoActual] IN {"1","2","4"})
Var Numerador1 = if( NOT ISEMPTY (var31), COUNTROWS(var31))
var Numerador = if( NOT ISEMPTY (var31),count('EHC'[AñoCorte]) - Numerador1)
var denominador= count('EHC'[AñoCorte])
Var ProporHemosev =  if( NOT ISEMPTY (var31),divide( Numerador,denominador*100))
return ProporHemosev

 

Final output:

vjianbolimsft_1-1672714394672.png

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-jianboli-msft
Community Support
Community Support

Hi @tatac1412 ,

 

You should modified this code: countx('EHC', var31)

Both EHC and var31 are tables, thus you can't make this measure work.

Based on your description, I have created a simple sample:

vjianbolimsft_0-1672714374390.png

Please try something like this:

 

ProporHemoSev<18 = 
Var var31=filter('EHC','EHC'[V31EsquemaTratamientoActual] IN {"1","2","4"})
Var Numerador1 = if( NOT ISEMPTY (var31), COUNTROWS(var31))
var Numerador = if( NOT ISEMPTY (var31),count('EHC'[AñoCorte]) - Numerador1)
var denominador= count('EHC'[AñoCorte])
Var ProporHemosev =  if( NOT ISEMPTY (var31),divide( Numerador,denominador*100))
return ProporHemosev

 

Final output:

vjianbolimsft_1-1672714394672.png

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

Try this version

 

 

ProporHemoSev<18 =
Var var31=filter('EHC','EHC'[V31EsquemaTratamientoActual] IN {"1","2","4"})
Var Numerador1 = if( NOT ISEMPTY (var31), countx('EHC', var31))
var denominador= count('EHC'[AñoCorte])
var Numerador = if( NOT ISEMPTY (var31),denominador - Numerador1)
return  if( NOT ISEMPTY (var31),divide( Numerador,denominador*100,0))

 

Helpful resources

Announcements
T-Shirt Design Challenge 2023

Power BI T-Shirt Design Challenge 2023

Submit your creative T-shirt design ideas starting March 7 through March 21, 2023.

March 2023 Update3

Power BI March 2023 Update

Find out more about the March 2023 update.

March Events 2023A

March 2023 Events

Find out more about the online and in person events happening in March!