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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Filter table using ALL() twice

I am struggling to produce a pivot(excel)/matrix table with a certain layout that has rows removed when a subtotal is zero in one column. I have data similar to below:
 
Date_______CostCentre____MatchingRef_____TransactionRef_____OtherCols____Amount
01/05/19___12345678______11111____________Test111____________Various_______100.00
01/06/19___12345678______11111____________Test112____________Various_______-100.00
01/05/19___12345678______11112____________Test113____________Various_______100.00
01/06/19___12345678______11112____________Test113____________Various_______-100.00
01/05/19___12345679______11113____________Test114____________Various_______100.00
01/06/19___12345679______11113____________Test115____________Various_______100.00
etc
I have a date table with a relationship to my date column above
 
I want to produce a table that returns just the CostCentre, the MatchingRef and the TransactionRef of those rows where the MatchingRef total is not zero. I will have a date slicer and a costcentre slicer. The problem I am getting is that I'm trying to filter both the Date column and also the MatchingRef column. So AmtTotal:=CALCULATE(SUM[Amount]),FILTER(ALL(dDate),dDate<=MAX(dDate)) returns the total amount to date based on the date selected in my filter and those lines. For example, run at June:
 
CostCentre____MatchingRef_____TransactionRef_____AmtTotal
12345678______11111____________Test111____________100.00
12345678______11111____________Test112____________-100.00
12345679______11113____________Test114____________100.00
12345679______11113____________Test115____________100.00
 
Works as expected, eliminating lines of MatchingRef of 11112 which total to 0. I want a "MatchedTotal" too however and this is where I run into issues/not sure how to achieve it.
 
I thought: MatchTotal:=CALCULATE([AmtTotal],FILTER(dataTable,dataTable[MatchingRef]=MAX(dataTable[MatchingRef])))
but this then removes the Date filter associated with the original [AmtTotal] measure. How do I avoid this removal of the filter, but still get the subtotal by MatchingRef?
 
Thanks in advance,
Rico

1 REPLY 1
Anonymous
Not applicable

Just to further clarify my original post, I was hoping for a final table that read like this:

 

CostCentre____MatchingRef_____TransactionRef_____AmtTotal___MatchTotal
12345678______11111____________Test111____________100.00_______0
12345678______11111____________Test112____________-100.00______0
12345679______11113____________Test114____________100.00_______100
12345679______11113____________Test115____________100.00________100

 

And I could then have the option of removing the "AmtTotal" measure and thus rows one and two are outstanding, showing the total correctly of 200 and the details behind that value by TransactionRef. 

 

I'm just not sure how to get that row context of MatchingRef applied in my total without using an "ALL" formula and thus removing the date filter from the previous ALL(dDate) context. 

 

Any assistance would be greatly appreciated.

 

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.