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
isThatAFrog
Frequent Visitor

DAX filter context - rows not impacted by datesbetween

Hi DAX experts

I have this calculation that I want to work in a table visiual so that I can calculate before and after the slicer applied, but it only works on the total, how to change this?
I have also tried with the Window function but i could not make it work, please help:

CALCULATE(COUNTROWS('Mobility setup')
        ;DATESBETWEEN('Mobility setup'[Effective date]
        ;MINX(ALL('Mobility setup');'Mobility setup'[Effective date])
        ;MAX('Mobility setup'[Effective date])
        )
)
Screenshot 2025-11-06 110929.pngScreenshot 2025-11-06 112913.png
1 ACCEPTED SOLUTION

Thank you for the help @lbendlin and @v-saisrao-msft 

The sample file was very good to recreate the issue but the measue did little more than countrows()
You were right to use the date table (I didnt because I had some issues with it) and my initial formula works just fine then 
With the following formula I got the result, but you could try something similar with EXCEPT() i guess 

    CALCULATE(COUNTROWS('Mobility setup')        
        ;DATESBETWEEN('DateTable'[Date]
            ;MINX(ALL('DateTable');'DateTable'[Date])
            ;MAX('DateTable'[Date])
        )
    )

View solution in original post

4 REPLIES 4
v-saisrao-msft
Community Support
Community Support

Hi @isThatAFrog,

Thank you @lbendlin, for your insights.

I have used the sample data and reproduced the issue at my end and got the below output also attached the pbix file for your reference:

vsaisraomsft_0-1762754715313.png

Thank you.

Thank you for the help @lbendlin and @v-saisrao-msft 

The sample file was very good to recreate the issue but the measue did little more than countrows()
You were right to use the date table (I didnt because I had some issues with it) and my initial formula works just fine then 
With the following formula I got the result, but you could try something similar with EXCEPT() i guess 

    CALCULATE(COUNTROWS('Mobility setup')        
        ;DATESBETWEEN('DateTable'[Date]
            ;MINX(ALL('DateTable');'DateTable'[Date])
            ;MAX('DateTable'[Date])
        )
    )
lbendlin
Super User
Super User

so that I can calculate before and after the slicer applied

Your slicer needs to feed from a disconnected calendar table.

 

And then you can use EXCEPT for a more concise filter.

grazitti_sapna
Super User
Super User

Hi @isThatAFrog,

 

Provide more details what you want to achieve, or share sample file

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.