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

Visual for a specific department and some employee from another department

Hi,

 

I have the request to share a table visual for a department but they also want to track some consultants who are in another department. I understand that i can't simply filter the department in my visual filter since the consultants are in another department. I could simply filter on my visual all the employee from the department and also all the consultants, but the visual would no longer be dynamic, allowing the department's latest employees to always be displayed.

 

Is there a way i could make a DAX filter that allows me to filter a department and also filter some employee that are not in this department?

 

Thanks for the help

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @WPastor ,

 

you can write a measure to filter the visual. 

 

Not sure if i fully get you, supposing you have a data table like:

Name Department Date
Amber Sales 12/1/2024
Bob Sales 12/2/2024
Candy Marketing 12/3/2024
David Marketing 12/4/2024
Ender Operation 12/5/2024
Frank Operation 12/6/2024
Greg Operation 12/7/2024

 

try to plot a visual with name column, pull a measure like below to the filter pane and choose 1:

 

FilterMeasure = 
VAR _last = 
MAXX(
    TOPN(
        1,
        FILTER(
            ALL(data), 
            data[Department] = MAX(data[Department])
        ),
        data[Date]
    ),
    data[Name]
)
VAR _result =
IF(
    OR(
        MAX(data[Department]) IN {"Sales"},
        MAX(data[Name]) = _last
    ),
    1,0
    )
RETURN _result

 

 

it works like:

FreemanZ_0-1729216279282.png

 

View solution in original post

1 REPLY 1
FreemanZ
Super User
Super User

hi @WPastor ,

 

you can write a measure to filter the visual. 

 

Not sure if i fully get you, supposing you have a data table like:

Name Department Date
Amber Sales 12/1/2024
Bob Sales 12/2/2024
Candy Marketing 12/3/2024
David Marketing 12/4/2024
Ender Operation 12/5/2024
Frank Operation 12/6/2024
Greg Operation 12/7/2024

 

try to plot a visual with name column, pull a measure like below to the filter pane and choose 1:

 

FilterMeasure = 
VAR _last = 
MAXX(
    TOPN(
        1,
        FILTER(
            ALL(data), 
            data[Department] = MAX(data[Department])
        ),
        data[Date]
    ),
    data[Name]
)
VAR _result =
IF(
    OR(
        MAX(data[Department]) IN {"Sales"},
        MAX(data[Name]) = _last
    ),
    1,0
    )
RETURN _result

 

 

it works like:

FreemanZ_0-1729216279282.png

 

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.