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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
SofiaG
New Member

Reporte de Encuestas de Satisfacción del Cliente

Buen día estimada comunidad, ¿cómo puedo realizar promedios o conteos o cualquier otra operación con campos que contienen texto? Estoy trabajando sobre un reporte de encuestas de satisfacción del cliente y en oportunidades las encuestas no son contestadas pero deben ser contabilizadas como tal, dentro del reporte. Cuando intento determinar el Promedio General de Calificaciones, al poseer valores que son textos, Power Bi no me permite realizar operaciones. ¿Cómo puedo prepar mis datos y solventar este problema? Mi fuente de Datos es un excel que posee tanto la información de las encuentas como cálculos para determinar estas variables pero quiero lograr realizar dichos cálculos desde Power Bi.

 

SofiaG_0-1687180876959.png

PD: Fijarse en la fila que indica "NO CALIFICÓ" y en el campo de "PROMEDIO". 

 

1 ACCEPTED SOLUTION
v-xinruzhu-msft
Community Support
Community Support

Hi @SofiaG 

You can use convert() function to change data type first, then calculate it

e.g 

Column =
VAR a =
    ADDCOLUMNS (
        'Table',
        "changetype", IF ( [PROMEDIO] <> "No", CONVERT ( [PROMEDIO], DOUBLE ) )
    )
RETURN
    AVERAGEX ( a, [changetype] )

vxinruzhumsft_0-1687312002295.png

You can refer to the following link to know more about the convert() function.

CONVERT function (DAX) - DAX | Microsoft Learn

 

Best Regards!

Yolo Zhu

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
SofiaG
New Member

Hi Yolo Zhu 😊

Thank you very much for your reply. It helped me solve my problem.

SofiaG_0-1687563055471.png
You are a genious. 💟

 

Surely, I will contact you soon.

Sofia G.

 

v-xinruzhu-msft
Community Support
Community Support

Hi @SofiaG 

You can use convert() function to change data type first, then calculate it

e.g 

Column =
VAR a =
    ADDCOLUMNS (
        'Table',
        "changetype", IF ( [PROMEDIO] <> "No", CONVERT ( [PROMEDIO], DOUBLE ) )
    )
RETURN
    AVERAGEX ( a, [changetype] )

vxinruzhumsft_0-1687312002295.png

You can refer to the following link to know more about the convert() function.

CONVERT function (DAX) - DAX | Microsoft Learn

 

Best Regards!

Yolo Zhu

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

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.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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