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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Ignore filter for one measure and apply for rest

Hi,

 

I have multiple measures which needs to be displayed in a table. Of these, 1 measure should remain unaffected by changing year filter and rest all measures should change as per selected year. I tried writing various dax queries but nothing worked.

 

Below is one of the dax I wrote. But still value changes when year filter is changed.

 

Closed_count =

var min_date = MINX(ALLSELECTED('Calendar'), 'Calendar'[Date])

var max_date = MAXX(ALLSELECTED('Calendar'), 'Calendar'[Date])

 

var closed_value = CALCULATE(DISTINCTCOUNT('details'[id]),

                   ALL('Calendar'),

                   FILTER('details',

                           'details'[status] = "closed" &&

                           'details'[trans_date] >= min_date &&

                           'details'[trans_date] <= max_date))

Return closed_value

 

Screenshot 2021-02-03 004011.png

As een in the image attached, count for pending should change with year selection, but count for closed should not change even if year filter is changed. 

 

I tried using all condition as well but no success. 

 

Any help how to achieve this.

 

Regards,

Amit Darak

 

1 ACCEPTED SOLUTION
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please try this formula.

Closed_count =
VAR min_date = MINX( ALL('Calendar'), 'Calendar'[Date] )
VAR max_date = MAXX( ALL('Calendar'), 'Calendar'[Date] )
VAR closed_value = 
CALCULATE(
    DISTINCTCOUNT('details'[id]),
    FILTER(
        ALL('details'),
        'details'[status] = "closed" &&
        'details'[trans_date] >= min_date &&
        'details'[trans_date] <= max_date)
)
Return 
closed_value

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please try this formula.

Closed_count =
VAR min_date = MINX( ALL('Calendar'), 'Calendar'[Date] )
VAR max_date = MAXX( ALL('Calendar'), 'Calendar'[Date] )
VAR closed_value = 
CALCULATE(
    DISTINCTCOUNT('details'[id]),
    FILTER(
        ALL('details'),
        'details'[status] = "closed" &&
        'details'[trans_date] >= min_date &&
        'details'[trans_date] <= max_date)
)
Return 
closed_value

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Sumanth_23
Memorable Member
Memorable Member

hi @Anonymous - The ALL condition should negate any selection on the Fiscal Year slicer. Its a silly question but the Fiscal Year slicer is setup from the Calendar table correct? 

 

Also can you share a sample pbix file with the report show in the above screenshot? Thanks! 

 

Please mark the post as a solution and provide a 👍 if my comment helped with solving your issue. Thanks!

 

Sumanth 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!

Proud to be a Super User!



Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.