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

Añadir Formato o cadena de texto en una medida según otra columna

Hola, estoy luchando con un problema que necesito resolver y no puedo encontrar la mejor solución.

Agradecería ayuda u otras sugerencias para solucionar el problema.

Tengo esta mesa y me interesa hacer una medida con el READING ComfortReading = AVERAGE(ConfortReadings[LECTURA])

Lo que necesitaría es agregar al resultado de la medición, según sea Temperatura, Humedad o CO2, el texto al final del resultado, si filtro en el display por Temperatura, agregar ºC al resultado, si es Humedad % y si es CO2 ppm

La idea es que con la misma medida valga para los distintos tipos de Metros pero que le agregue el texto correspondiente, adjunto como debe ser el resultado

Supongo que tendré que cambiar el tamaño pero no encuentro la solución. Estaría infinitamente agradecido por su ayuda. Mis mejores deseos.

datos_confort.JPGformato_datos_confort.JPG

1 ACCEPTED SOLUTION

Hi @sunnypb,

You can't direct do aggregation on these text values.

I'd like to suggest you write a measure formula for different category types and set custom formatting strings to change the display value and symbol, they should not effet you to use aggregate features.

Use custom format strings in Power BI Desktop - Power BI | Microsoft Docs

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
Aditya_Meshram
Solution Supplier
Solution Supplier

Hi @sunnypb ,
you can try making this calculated column

Result column = 
FIXED(LECTURA,0) & 
SWITCH(
CONTADOR,
"Temperatura","ºC",
"Humedad","%",
"CO2","ppm"
)


Regards,
Aditya


THANK YOU VERY MUCH FOR THE PROMPT RESPONSE, EFFECTIVELY IT CREATED A CALCULATED COLUMN WITH THE NUMBER AND THE TEXT, MY QUESTION WOULD BE, CAN I MAKE AN AVERAGE WITH THAT CALCULATED COLUMN? BEING A STRING TYPE, IT DOESN'T LET ME, I DON'T KNOW IF YOU CAN MAKE A NUMERICAL TYPE.... thank you

Hi @sunnypb,

You can't direct do aggregation on these text values.

I'd like to suggest you write a measure formula for different category types and set custom formatting strings to change the display value and symbol, they should not effet you to use aggregate features.

Use custom format strings in Power BI Desktop - Power BI | Microsoft Docs

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.

Top Solution Authors