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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
naelske_cronos
Helper III
Helper III

DAX - remove filter and add it again after full aggregation

Hello

 

I have a DAX question about remove filters:

 

This is my measure:

_AverageMachineHoursV1 = 
CALCULATE ( 
    AVERAGEX (
        FILTER (
            DIM_Date,
            YEAR ( [Date] )
                = YEAR ( [_SelectedDate] ) - 1
                && NOT ( [DayOfWeekNumber] IN { 6, 7 } )
        ),
        CALCULATE ( SUM ( FACT_Productivity[MHOURS] ) )
    ),
    REMOVEFILTERS ( DIM_Machine ),
    REMOVEFILTERS ( DIM_Department )
)

With this measure I just want a sum of the total machine hours of last year ignoring the filters on DIM_Department and DIM_Machine. I just want the average of machines hours filtered on weeknumber.

What I want is that after the result I want to keep the aggregation result but when I select a department, it only shows the machines that are related to the selected department. Like in the image below, I selected department 'B' and I expect is that machine "0000B" is removed from table but still keeping the average results. Is that possible? Even with my data model?

naelske_cronos_0-1734086642776.png

naelske_cronos_1-1734086683939.png

 

 

Thank you
Kind regards

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You could create a measure like

Is Visible =
IF (
    SELECTEDVALUE ( DIM_Machine[DepartmentID] )
        IN VALUES ( DIM_Department[DepartmentID] ),
    1
)

and add that as a filter to visual, to only show when the value is 1.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hello,

Did the solution johnt75  offered help you solve the problem, if it helps, you can consider to accept it as a solution so that more user can refer to, or if you have other quertsions, can provide some information so that can offer more suggestion for you.

 

Best Regards!

Yolo Zhu

 

 

johnt75
Super User
Super User

You could create a measure like

Is Visible =
IF (
    SELECTEDVALUE ( DIM_Machine[DepartmentID] )
        IN VALUES ( DIM_Department[DepartmentID] ),
    1
)

and add that as a filter to visual, to only show when the value is 1.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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