Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.