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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Anonymous
Not applicable

Divide with filters error

Hallo,

I've got a problem with this table.

 

https://www.dropbox.com/s/ii6q02bn9kltvef/Cartel1.xlsx?dl=0 

 

iN this file we have are 2 tables:

1: Carico_4

2: Carico_uph

 

Ive made the second table with this formulas:

Carico_uph = summarize(Carico_4, Carico_4[Date], Carico_4[Ore], Carico_4[CIRCUITO], "op nr", distinctcount(Carico_4[MATRICOLA]), "contenitori",count(Carico_4[CONTENITORE]))
 
In Power Bi desktop, I filled in the filter  for all pages = 14 Aug
TARGET: have in table 2 a formula DAX--> SUM of total "CONTENITORE" divided total "OP NR", filtered for CIRCUITO=XD or XK, and with the filter in all pages applied
 
Here what I've done till now, for it:
UPH_XD = divide(calculate(sum(Carico_uph[contenitori]), filter(Carico_uph, Carico_uph[CIRCUITO]="XD")), calculate(sum(Carico_uph[op nr]), filter(Carico_uph,Carico_uph[CIRCUITO]="XD")))
 
but it doesn't work. I think it doesn't apply the filter in all page.
Do you have a trick to solve it?
1 ACCEPTED SOLUTION
Pragati11
Super User
Super User

Hi @Anonymous ,

 

Try modifying your DAX as follows:

UPH_XD = divide(

calculate(sum(Carico_uph[contenitori]), filter(ALLSELECTED(Carico_uph), Carico_uph[CIRCUITO]="XD")), calculate(sum(Carico_uph[op nr]), filter(ALLSELECTED(Carico_uph),Carico_uph[CIRCUITO]="XD")), 0

)

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

2 REPLIES 2
Pragati11
Super User
Super User

Hi @Anonymous ,

 

Try modifying your DAX as follows:

UPH_XD = divide(

calculate(sum(Carico_uph[contenitori]), filter(ALLSELECTED(Carico_uph), Carico_uph[CIRCUITO]="XD")), calculate(sum(Carico_uph[op nr]), filter(ALLSELECTED(Carico_uph),Carico_uph[CIRCUITO]="XD")), 0

)

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Hi

I filled in ur formula:

UPH_XD = divide(

calculate(sum(Carico_uph[contenitori]), filter(ALLSELECTED(Carico_uph), Carico_uph[CIRCUITO]="XD" || Carico_uph[CIRCUITO]="XK")), calculate(sum(Carico_uph[op nr]), filter(ALLSELECTED(Carico_uph),Carico_uph[CIRCUITO]="XD" || Carico_uph[CIRCUITO]="XK")), 0

)
But the output is wrong yet
tot contenitori: 546
ttot op nr= 88
it should be 6,2 but it is 8,28

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
Top Kudoed Authors