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
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.

Top Solution Authors
Top Kudoed Authors