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
Anonymous
Not applicable

ALL function not working when multiple page filters are used.

I have 2 tables Table1 and Table2 (Both are linked using a "PKID")and I have a PowerBI page where I use page filters from
Table1 --- Table1[FID] and Table1[OID] and I have a table widget in the page displaying 2 columns and the below measures from Table2 (I'm trying to get numbers and percentage values)

FNumbers = CALCULATE(sum(Table2[validRecordbit]))

FPercentage = VAR YesCID =CALCULATE(sum(Table2[validRecordbit]))
              VAR AllCID = CALCULATE(sum(Table2[validRecordbit])
                           ,FILTER(ALLSELECTED(Table2),Table2[Acol] = MAX(Table2[Acol])))
              VAR RESULT = DIVIDE(YesCID, AllCID, 0)
              RETURN
              RESULT

ONumbers = CALCULATE(sum(Table2[validRecordbit]),ALL(Table1[FID]))
Opercentage = VAR YesCID =CALCULATE(sum(Table2[validRecordbit])
                                    ,ALL(Table1[FID]))
              VAR AllCID = CALCULATE(sum(Table2[validRecordbit])
                           ,FILTER(ALLSELECTED(Table2),Table2[Acol] = MAX(Table2[Acol]))
                           ,ALL(Table1[FID]))
             VAR RESULT = DIVIDE(YesCID, AllCID, 0)
             RETURN
             RESULT


All the above measures are working fine when just page filter (Table1[OrgID]) is used.

But when using both the page filters (Table1[FID] and Table1[OID]) the values returning for the measure "Opercentage" is incorrect and the below code is ignoring the ALL(Table1[FID]) and using the Fnumber values for division

VAR AllCID = CALCULATE(sum(Table2[validRecordbit])
                           ,FILTER(ALLSELECTED(Table2),Table2[Acol] = MAX(Table2[Acol]))
                           ,ALL(Table1[FID]))

. Why ALL(Table1[FID]) not working for Opercentage when both page filters are used-- {I'm just trying to get sum of validrecordbit column groupby(Acol)}

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Using the below code 

VAR AllCID  = CALCULATE(sum(Table2[validRecordbit])
,ALLEXCEPT(Table2,Table2[Acol],Table1[OID])
)

got it worked.  Replace FID with OID since ALLEXCEPT will remove all other filters except the ones mentioned.  

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Using the below code 

VAR AllCID  = CALCULATE(sum(Table2[validRecordbit])
,ALLEXCEPT(Table2,Table2[Acol],Table1[OID])
)

got it worked.  Replace FID with OID since ALLEXCEPT will remove all other filters except the ones mentioned.  

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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