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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Syndicate_Admin
Administrator
Administrator

suma condicional en una tabla filtrada

Hola a todos

desde una base de datos, aquí el enlace, hice este resumen de diversión:

Pick_PKuph = resumen(filter(PICK, PICK[TIPO]= "PK"),PICK[ORA], PICK[GIORNO], "tot", sum(PICK[TOTALE]), "Prel", sum(PICK[PRELEVATO]), "ops nr", DISTINCTCOUNT(PICK[MATRICOLA]), "Contenitori", count(PICK[CONTENITORE]))

¿Cómo podemos hacer una suma condicional de TOT mientras filtramos:

- la suma de TOT por cada ORA, por cada MATRICOLA, debe ser > 7?

Aquí se alcanzó el resultado:

Nt a 30847983364764837911740378025744545265380131
Sin operaciones 6131819141243137983129

En el enlace adjunto se muestran todos los datos y también un ejemplo de tabla dinámica para aconditivar la salida

Gracias por ayuda

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

Nr Ops := 
var a = SUMMARIZE(PICK,PICK[ORA],PICK[MATRICOLA],"Tot",sum(PICK[TOTALE]))
return COUNTROWS(filter(a,[Tot]>7)) 

Nt Tot := 
var a = SUMMARIZE(PICK,PICK[ORA],PICK[MATRICOLA],"Tot",sum(PICK[TOTALE]))
return SUMX(filter(a,[Tot]>7),[Tot]) 

lbendlin_0-1613789425215.png

Hice el filtro PK a nivel de página, pero puedes agregarlo a las medidas si quieres.

lbendlin_1-1613789458974.png

View solution in original post

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

Nr Ops := 
var a = SUMMARIZE(PICK,PICK[ORA],PICK[MATRICOLA],"Tot",sum(PICK[TOTALE]))
return COUNTROWS(filter(a,[Tot]>7)) 

Nt Tot := 
var a = SUMMARIZE(PICK,PICK[ORA],PICK[MATRICOLA],"Tot",sum(PICK[TOTALE]))
return SUMX(filter(a,[Tot]>7),[Tot]) 

lbendlin_0-1613789425215.png

Hice el filtro PK a nivel de página, pero puedes agregarlo a las medidas si quieres.

lbendlin_1-1613789458974.png

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.