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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
apcor
Frequent Visitor

Help for function "ALL"

Hi,

 

I am new using power BI, I have learned some formulas in DAX, however I have some doubts about when to use ALL when using the FILTER function. In the image below I show a part of the model that I developed, there are 3 tables: the Requirements table (RQPax), states (EstPrin) and Dates.

 

modelo.jpg

 

What I want to obtain is the accumulated requirements with status "Planned" by date.The requirements with status "Planned" have planning dates of 01/27, 01/28, 01/31, 02/01, 02/02. On 01/29 and 01/30 there are no planned requirements. I initially developed this formula:

AcumPaxPlanifV2 = CALCULATE(COUNTA(RQPax[CÓDIGO DE CUPO]),FILTER(EstPrin, EstPrin[Estados Principales]="Planificado"),FILTER(ALL(Fechas), Fechas[Fecha] <= MAX(Fechas[Fecha])))+0

The result obtained was not as desired as seen in the image:

tabla1.jpg

As soon as I add the ALL function in the EstPrin table I get the desired result:

AcumPaxPlanifV2 = CALCULATE(COUNTA(RQPax[CÓDIGO DE CUPO]),FILTER(ALL(EstPrin), EstPrin[Estados Principales]="Planificado"),FILTER(ALL(Fechas), Fechas[Fecha] <= MAX(Fechas[Fecha])))+0

tabla2.jpg

I know it has to be related to the planning dates, but could someone explain the logic to me, thanks for the help !!

 

Regards

Anthony

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@apcor . without all on EstPrin, it was filtering the date also which could have appeared because of the next filter.

check if this gives the same result as the second formula

AcumPaxPlanifV2 = CALCULATE(COUNTA(RQPax[CÓDIGO DE CUPO]), EstPrin[Estados Principales]="Planificado",FILTER(ALL(Fechas), Fechas[Fecha] <= MAX(Fechas[Fecha])))+0
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@apcor . without all on EstPrin, it was filtering the date also which could have appeared because of the next filter.

check if this gives the same result as the second formula

AcumPaxPlanifV2 = CALCULATE(COUNTA(RQPax[CÓDIGO DE CUPO]), EstPrin[Estados Principales]="Planificado",FILTER(ALL(Fechas), Fechas[Fecha] <= MAX(Fechas[Fecha])))+0
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks

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