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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.