Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hola, necesito ayuda en DAX mientras calculo el promedio de Ecode. La condición sería si el recuento del código S coincide con el recuento distinto del código E, excluirá al calcular el promedio. Si el recuento del código S no coincide con el recuento distinto del código E, entonces tomará un recuento distinto del código E y, en base a eso, necesito calcular el promedio. ¿Cuál debería ser el enfoque? Cualquier ayuda sería realmente apreciada.Shown here how it would be calculatedAquí se muestra cómo se calcularía
¿Es esto lo que estás buscando?
Control = VAR _DisE =DISTINCTCOUNT('Table'[E Code])
VAR _CounS = COUNT('Table'[S Code])
VAR _Cont = IF(_DisE<> _CounS,_DisE)
RETURN
_Cont
Flag = IF([Control],1,0)
Final = var _t1 = SUMX(VALUES('Table'[S Code]),[Control])
VAR _t2 = SUMX(VALUES('Table'[S Code]),[Flag])
RETURN
_t1/_t2Archivo PBIX de muestra adjunto
https://dropmefiles.com/EJ14P

Hola, esta es la solución exacta que estaba buscando. Muchas gracias.
Este es un enfoque para resolver el problema en DAX:
Coincidencia = CONTAR(S_Code) = DISTINCTCOUNT(E_Code)
E_Code_Count = IF([Match]=TRUE(),0,DISTINCTCOUNT(E_Code))
Avg_E_Code = AVERAGEX(FILTER(ALL(Table),[E_Code_Count]>0),[E_Code])
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.