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
Syndicate_Admin
Administrator
Administrator

Calcular la mediana a partir de la columna calculada

Hola

Tengo la siguiente tabla calculada.

Yeztrom_0-1651532905260.png

Esa tabla se genera con la siguiente medida.

DÓNDE _VW_Prices_Mode =
FILTRO(
_VW_Prices_Mode_Retalers_No_Model,
[Year_Week| Max_Rep] EN _VW_Prices_List_Year_Weeek_and_Max_Rep
)
Necesito calcular la mediana de la columna product_current_price molesta por las columnas master_product_id y year_week relacionadas.
Lo intenté con la siguiente medida, pero no funcionó.
DONDE _VW_Prices_Mode_Clear =
RESUMIR(
_VW_Prices_Mode,
[master_product_id],
[year_week relacionados],
"Modo",MEDIANX(_VW_Prices_Mode,[product_current_price])
)
El resultado fue este.
Yeztrom_1-1651533453153.png

La columna "Modo" no se agrupó por "master_product_id" ni por "year_week relacionados"

Pensé en usar GROUPBY pero parece que no es compatible con MEDIANX

Me gustaría saber si hay una manera de hacerlo.

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

@Yeztrom , Esto tomará la columna completa, Intente como

Si es necesario, use agregar columnas para agregar la columna siguiente

VAR _VW_Prices_Mode_Clear =
RESUMIR(
_VW_Prices_Mode,
[master_product_id],
[year_week relacionados],
"precio",[product_current_price]
)

Nueva columna = MEDIANX(filter(Table, [master_product_id] = earlier([master_product_id]) && [related year_week] = earlier([related year_week]) ), [Price])

o

Nueva columna = MEDIANX(filter,, [related year_week] = earlier([related year_week]) ), [Price])

View solution in original post

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

@Yeztrom , Esto tomará la columna completa, Intente como

Si es necesario, use agregar columnas para agregar la columna siguiente

VAR _VW_Prices_Mode_Clear =
RESUMIR(
_VW_Prices_Mode,
[master_product_id],
[year_week relacionados],
"precio",[product_current_price]
)

Nueva columna = MEDIANX(filter(Table, [master_product_id] = earlier([master_product_id]) && [related year_week] = earlier([related year_week]) ), [Price])

o

Nueva columna = MEDIANX(filter,, [related year_week] = earlier([related year_week]) ), [Price])

Gracias

La solución fue:

DÓNDE _VW_Prices_Mode_Clear =
RESUMIR(
_VW_Prices_Mode,
[master_product_id],
[year_week relacionados],
"Modo",MEDIANA(FILTRO(_VW_Prices_Mode, [master_product_id] = ANTERIOR([master_product_id]) && [year_week relacionados] = ANTERIOR([year_week relacionados]) ), [product_current_price])
)

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

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