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
Carol_oteg
Frequent Visitor

Personalizar el formato de los valores de una VAR

Hola buenas tardes, tengo una inquietud, agradezco mucho si me pueden ayudar.

 

Estoy intentando incluir en una misma columna, valores en moneda y porcentajes, solo me salen en moneda

 

Carol_oteg_0-1666219969339.png

Para lograr esta estructura, estoy empleando la siguiente medida

 

P&G CONTABLE = Var P_G = SELECTEDVALUE(DIM_ESTRUCTURA[Estructura Estado de Resultados])
VAR Ingresos= CALCULATE([Mov_Final],DIM_CUENTAS[Categoria]="Ingresos Operacionales")
VAR Costos= CALCULATE([Mov_Final],DIM_CUENTAS[Categoria]="Costos")
VAR C_Indirec=CALCULATE([Mov_Final],DIM_CUENTAS[Categoria]="Costos Indirectos")
VAR Costo_Total_venta=((C_Indirec+Costos)/Ingresos)*100
VAR U_Bruta= Ingresos-Costos-C_Indirec
VAR M_Bruto= (U_Bruta/Ingresos)*100
 

Return
SWITCH(P_G,
    "Ingresos Operacionales", Ingresos,
    "Costos", Costos,
    "Costos Indirectos", C_Indirec,
    "Costo Total % Venta",Costo_Total_venta,
    "Utilidad Bruta", U_Bruta,
    "Margen Bruto %",M_Bruto,
 


BLANK())
 
 
Intenté añadir la función Format, Format pero no me funciona, la inclui en la parte inicial asi:
 
VAR M_Bruto= Format(U_Bruta/Ingresos,"Percent")
 
Gracias por las ideas que me puedan dar 🙂
1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Carol_oteg ;

You could create a new measure as follow:

Measure = IF( CONTAINSSTRING(MAX('Table'[Estructura Estado de Resultados]),"%"),
                 FORMAT([P&G CONTABLE],"0.00%"),
                 FORMAT( [P&G CONTABLE], "Currency"))

The final show:

vyalanwumsft_0-1666245030411.png


Best Regards,
Community Support Team _ Yalan Wu
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-yalanwu-msft
Community Support
Community Support

Hi, @Carol_oteg ;

You could create a new measure as follow:

Measure = IF( CONTAINSSTRING(MAX('Table'[Estructura Estado de Resultados]),"%"),
                 FORMAT([P&G CONTABLE],"0.00%"),
                 FORMAT( [P&G CONTABLE], "Currency"))

The final show:

vyalanwumsft_0-1666245030411.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Mil gracias!!!! Funcionó perfecto

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.