The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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
Solved! Go to Solution.
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:
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: