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
brose
Regular Visitor

Filter by Sub-Totals in Matrix

Hello Everyone - I'm having an issue with creating a filter on sub-totals in a matrix.  The current matrix has the shown values below: 

 

Planned hours snip.PNG

 

My goal is to filter on the total sum of planned hours for the next 8 calendar weeks for a specific name.  So my first thought was to create a running Sum command like below:

 

DAS.png 

 

The problem I'm running into is the sum calculation is looking at the lower level customer sub-total in the matrix when doing the search.  Below is a picture of the matrix before doing any filtering on running sum total:

 

Snip 1.PNG

I then added the calcuated sum measure to my filters and put in calculated sum is less than 100.  My expectation here is the name Lisa would be removed from the matrix becuase her total is 252, but that's not what happened.  It only removed the column for company 2 for Lisa.  

 

Snip 2.PNG

Is there a way to have a lower level like company in the matrix but filter by the total of name which is the higher level?  The goal of this report is to show all resources for the next week that have under a specific number of planned hours.  Any help would be very much appreciated!!! 

6 REPLIES 6
v-lionel-msft
Community Support
Community Support

Hi @brose

You have a matrix, like this:

d2.PNG

 

And what you want is like this, right?

d3.PNG

 

But when you filtered the measure you created, you got this, right?

d4.PNG

 

And the reason why that happens is because your formula returns something like this:

d5.PNG

 

So, you can modify your DAX like this:

Measure = 
CALCULATE(
    SUM([Planned Hours]),
    ALLEXCEPT(
        Sheet6,
        Sheet6[Name]
    )
)

 

Best regards,
Lionel Chen

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Lionel - Thank you for the response.  When I put in the calculation (Seen below and then filter by Available is less then 40) for the next 8 calendar weeks I get 

 

Calc 12.PNG

Table 1_LI.jpg

 

 

If I take the filter away you will see all of those other weeks populate. 

 

Capture 3_LI.jpg

 

What I want to happen is for the next 8 weeks show me anyone who has less than 100 hours and only Bryan should show up in the list, Lisa and Robb Should fall off.  Let me know if this doens't make any sense.  

 

Hi @brose ,


"What I want to happen is for the next 8 weeks show me anyone who has less than 100 hours and only Bryan should show up in the list, Lisa and Robb Should fall off.  "
Do you mean you want to filter by sub-total, such as "sum of Bryan" , "sum of Lisa", "sum of Robb"?

 

which table does your each column come from?
And what's the relationship between these tables?

Please give me a sample data model.

Best regards,
Lionel Chen

Correct I want the "sum of Bryan" , "sum of Lisa", "sum of Robb"? and then be able to filter by quantity.  Example.  Anyone with more than 100 hours planned over the next 3 calendar weeks don't show up in the view.  Below are the fields I'm using.  Tables are Person (Import)

Planned Hours

Begin Date 

Values2.PNG

brose
Regular Visitor

Any ideas on this one? @v-lionel-msft 

brose
Regular Visitor

 One thing to add, this is how the tables and values are structured..

 

Values.PNG

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.