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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
BLM24
New Member

Filter Table Column

buenos días, 

Estoy intentando crear una media ponderada de los cinco registros anteriores a uno dado, para ello, he creado una columna:

Media Column Ud =
VAR prod = Costes[producto]
VAR fechaFab = Costes[Fecha Fab.]
VAR media = CALCULATE(DIVIDE(SUMX(Costes,Costes[Caldo / Ud.]*Costes[Uds Fabricadas]),SUM(Costes[Uds Fabricadas])), TOPN(5, FILTER(ALL(Costes), Costes[producto] = prod && DATEDIFF(Costes[Fecha Fab.],fechaFab,DAY)>=0), Costes[Fecha Fab.],  DESC))

RETURN media
 
Mi problema, es que cuando uso un segmentador de un campo de la tabla "Costes", el valor de la media no cambia. 
¿Qué debería hacer?
 
gracias a todos
 
4 REPLIES 4
Anonymous
Not applicable

Hi @BLM24 ,

You are creating a calculated column and not a measure, the value of the calculated column does not change dynamically. Each time you change the value in the slicer, you need to refresh the visual object in order for the calculated column to update its value.
If you want to realize that a change in the value of slicer is immediately followed by a change in the value of Media Column Ud, then you can only use measure to achieve this. Please provide some sample data and expected results, it is hard for DAX alone to correctly modify it for you.

Best Regards,
Dino Tao

uzuntasgokberk
Super User
Super User

Hola @BLM24 ,
¿Puedes usar ALLSELECTED en lugar de ALL? Por ejemplo,
ALLSELECT(Costos)

 

Se esta publicação ajudar, considere aceitá-la como solução e kudos para ajudar os outros membros a encontrá-la mais rapidamente.

 

Kind Regards,
Gökberk Uzuntaş

📌 If this post helps, then please consider Accepting it as a solution and giving Kudos — it helps other members find answers faster!

🔗 Stay Connected:
📘 Medium |
📺 YouTube |
💼 LinkedIn |
📷 Instagram |
🐦 X |
👽 Reddit |
🌐 Website |
🎵 TikTok |

 

bhanu_gautam
Super User
Super User

@BLM24 , Try using below DAX

Media Column Ud =
VAR prod = Costs[product]
VAR fabdate = Costs[Fab.Date]
VAR average = CALCULATE(
DIVIDE(
SUMX(Costes, Costes[Broth / Unit] * Costes[Manufactured Units]),
SUM(Costes[Manufactured Units])
),
TOPN(
5,
FILTER(
ALLSELECTED(Costes),
Costes[product] = prod && DATEDIFF(Costes[Manufacturing Date], fabdate, DAY) >= 0
),
Costes[Manufacturing Date], DESC
)
)
RETURN average




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Gracias,

he usado ALLSELECTED(Costes), pero el resultado es exactamente el mismo, no cambia el valor

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors