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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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