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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register 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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.