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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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