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
BG919
Frequent Visitor

Filter matrix rows using a measure without affecting totals

I have a matrix with a row hierarchy of:

State

City

Facility

Job Family

Job Title

 

I have a headcount column which is a measure:

Headcount = CALCULATE(

COUNTROWS('Dim_Org Structure'))
 
I need to apply a visual filter to hide rows where the headcount is less than 5. So if a job title has fewer than 5 employees, it doesn't show up in the matrix, but those employees are still counted in the job family, facility, city, state subtotal rollups. Or if an entire job family has fewer than 5 employees at a given facilty, it doesn't show, but is still reflected for facility headcount, etc.
 
But I also still need to be able to slice by department so that HR, Finance, Manufacturing, etc. can see their headcount across facilities.  I have tried various SWITCH, ALLEXCEPT, ISINSCOPE, HASONEFILTER combinations from other threads, which let me keep my unfiltered hierarchy subtotals while hiding rows, but they in turn are not responsive to the department slicer. 
1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @BG919 

 

Can you share a sample of your data and the result you are looking for?

 

BTW, you can add If statment to show blank when the headcount is less than 5.

Try this:

Headcount =
VAR _V =
    CALCULATE ( COUNTROWS ( 'Dim_Org Structure' ) )
RETURN
    IF ( _V < 5, BLANK (), _V )



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

Appreciate your Kudos!!



View solution in original post

2 REPLIES 2
BG919
Frequent Visitor

Thanks! I figured it would be something simple, but I was stuck.

VahidDM
Super User
Super User

Hi @BG919 

 

Can you share a sample of your data and the result you are looking for?

 

BTW, you can add If statment to show blank when the headcount is less than 5.

Try this:

Headcount =
VAR _V =
    CALCULATE ( COUNTROWS ( 'Dim_Org Structure' ) )
RETURN
    IF ( _V < 5, BLANK (), _V )



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

Appreciate your Kudos!!



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.

Top Solution Authors