Forum Discussion

javiermm's avatar
javiermm
New Member
2 years ago
Solved

FORMATOS DIFERENTES MISMA COLUMNA

Buenas,

 

Tengo unas columnas que tienen diferentes formatos.

 

Necesito que salgan en €, en porcentaje y en número entero.

 

Necesito que me aparezcan así en PBI.

 

Muchas gracias por anticipado.

 

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Thank you very much for the method lbendlin , I tried to create the data myself and implement it.

     

    Hi javiermm 

    Based on your needs, I have created the following table.

     

    Then you can use the following DAX to get the result you want:

    MEASURE = 
    IF (
        SELECTEDVALUE ( 'Table'[Column1] ) = "Storage per liter",
        FORMAT ( SELECTEDVALUE ( 'Table'[Column2] ), """€"" #,0.00" ),
        IF (
            SELECTEDVALUE ( 'Table'[Column1] ) = "Euros consumption",
            FORMAT (
                SELECTEDVALUE ( 'Table'[Column2] ),
                "General Number"),
                FORMAT ( SELECTEDVALUE ( 'Table'[Column2] ), "Percent" )
            )
        )

     

     

    Result:

     

     

     

     

     

    Best Regards,

    Jayleny

     

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

     

3 Replies

  • You would normally use FORMAT for that.  Have you tried that?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thank you very much for the method lbendlin , I tried to create the data myself and implement it.

     

    Hi javiermm 

    Based on your needs, I have created the following table.

     

    Then you can use the following DAX to get the result you want:

    MEASURE = 
    IF (
        SELECTEDVALUE ( 'Table'[Column1] ) = "Storage per liter",
        FORMAT ( SELECTEDVALUE ( 'Table'[Column2] ), """€"" #,0.00" ),
        IF (
            SELECTEDVALUE ( 'Table'[Column1] ) = "Euros consumption",
            FORMAT (
                SELECTEDVALUE ( 'Table'[Column2] ),
                "General Number"),
                FORMAT ( SELECTEDVALUE ( 'Table'[Column2] ), "Percent" )
            )
        )

     

     

    Result:

     

     

     

     

     

    Best Regards,

    Jayleny

     

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