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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Syndicate_Admin
Administrator
Administrator

Si columna de texto = x entonces medida decimal = y

Hola

Tengo un texto col 'Personalizado' y una medida decimal 'Últimos 8 Wks ofrecidos'

Lo que estoy tratando de devolver es que si 'Personalizado' = "Cuidador" entonces 'Últimos 8 Wks ofrecidos' = "N / A" de lo contrario 'Últimas 8 semanas ofrecidas'

Test = IF(Append1[Custom] = "Carer",FORMAT([Last 8 Wks Offered],BLANK(),"en-GB"),[Last 8 Wks Offered])
Lo anterior devuelve el error 'Las expresiones que producen el tipo de datos variante no se pueden usar para definir columnas calculadas'.
1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

@Qotsa

No es posible tener diferentes tipos de datos en una columna, cambie la otra parte a texto modificando la fórmula de la siguiente manera:

Test =
IF (
    Append1[Custom] = "Carer",
    FORMAT ( [Last 8 Wks Offered], BLANK (), "en-GB" ),
    FORMAT ( [Last 8 Wks Offered] , "#,0.00")
)





View solution in original post

3 REPLIES 3
Syndicate_Admin
Administrator
Administrator

@PC2790 Eso lo hace. TY.

Syndicate_Admin
Administrator
Administrator

Puede hacer algo dentro de la medida: [Últimos 8 Wks ofrecidos] como:

Medida DAX =

var selectedcustom = SelectedValue(Append1[Personalizado] )

devolución
IF(selectedcustom = "Cuidador",BLANK(),)

Syndicate_Admin
Administrator
Administrator

@Qotsa

No es posible tener diferentes tipos de datos en una columna, cambie la otra parte a texto modificando la fórmula de la siguiente manera:

Test =
IF (
    Append1[Custom] = "Carer",
    FORMAT ( [Last 8 Wks Offered], BLANK (), "en-GB" ),
    FORMAT ( [Last 8 Wks Offered] , "#,0.00")
)





Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.