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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.