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
Anonymous
Not applicable

Create a Summarize Table using Median - Error Varian type

I want to creat a summarize table that contains the average and the median of a variable. The problem begins when I start to calculate the median, it shows a message "The DAX expression for calculated table 'Cumplimiento SLA' results in a variant data type for column 'Mediana Días'. Please modify the calculation such that the column has a consistent data type.". The Dax is:

 

Cumplimiento SLA =
SUMMARIZE(
FILTER(SLA_BcaEmpresas,SLA_BcaEmpresas[ETAPA] = "TOTAL SLA NEGOCIO")
,SLA_BcaEmpresas[MES]
,SLA_BcaEmpresas[(ORDEN) MES]
,SLA_BcaEmpresas[TIPO OPERACIÓN]
,"Promedio Días", AVERAGE(SLA_BcaEmpresas[Días])
,"Mediana Días", MEDIAN(SLA_BcaEmpresas[Días])
)
 
I read that this is because the "MEDIAN" is a varint type for the column, so some people to force the column to return a double value put a "*1.0" but in this case I tried and shows other error message "The MEDIAN function only accepts a column reference as the argument number 1."
 
What could do i do?
1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You may use  MEDIANX function:

 

MEDIANX ( SLA_BcaEmpresas, [Días] *1.0 )

 

Best Regards,

Amy

 

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-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You may use  MEDIANX function:

 

MEDIANX ( SLA_BcaEmpresas, [Días] *1.0 )

 

Best Regards,

Amy

 

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

Anonymous
Not applicable

It works! Thak u so much.

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.