Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. 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])
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.