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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Dax for displaying only dates from selected range on date slicer

Hi Experts,

 

I need help in showing dates only from selected range on the date slicer. 

For example in the following snapshot of my fortnightly report, I expect the report to display only the records highlighted in yellow( as the Period selected is between 8/4/2019 to 5/5/2019)

 

fort_capture.PNG

 

Thanks in advance,

Meena

1 ACCEPTED SOLUTION

Just check if can create two more variables using MINX, MAXX - https://docs.microsoft.com/en-us/dax/minx-function-dax,

Use the filter example and find the min week start date when min week start date > Start_date of the slicer. Same way Max

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

You can try the use of slicer from here

https://medium.com/chandakamit/power-bi-comparing-data-across-date-ranges-36be49b68613

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks @EVEAdmin  and @amitchandak for your response.

Though the links are very useful, but i can't figure out how can i implement the solution in my scenario.

So, basically I have a table called 'Emp', that I get employees fortnightly payments from. I created a non related table called 'Dim week ending' with DAX- ALLSELECTED(Emp[Period_end_date]. Then I created a measure to calculate fortnightly payments as following:

Total fortnightly payment =

VAR _lastdate =

    CALCULATE (

        MAX ( 'Dim week ending'[Period End Date] ),

        FILTER (

            ALLSELECTED ( 'Dim week ending'[Period End Date] ),

           'Dim week ending'[Period End Date] < MAX ( 'Dim week ending'[Period End Date])

        )

    )

RETURN

    IF (

        MAX ( 'Dim week ending'[Period End Date] ) <= MAX ( ‘Emp’[Period End Date]),

        CALCULATE (

            SUM ( ‘Emp’ [Amount] ),

            FILTER (

                ALL (‘Emp’ [Period End Date] ),

                ‘Emp’ [Period End Date] <= MAX ( 'Dim week ending'[Period End Date])

                    && ‘Emp’ [Period End Date]> _lastdate

            )

        )

    )

 

I would highly appreciate if you can tell me where to include the logic for displaying only the fortnightly periods selected from the date range slicer.

 

Thanks,

Meena

The table shown in the first example may work like this

 

Measure1 =
var MIN_SLICER_DATE = MIn(Silcer(DATE))
var MAX_SLICER_DATE = MAX(Silcer(DATE))
CALCULATE (

SUM ( ‘Emp’ [Amount] ),

‘Emp’ [Period End Date] >= MIN_SLICER_DATE

&& ‘Emp’ [Period End Date] <=MAX_SLICER_DATE

)

But if the weekend date need to be calculated then more logic is needed 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Just check if can create two more variables using MINX, MAXX - https://docs.microsoft.com/en-us/dax/minx-function-dax,

Use the filter example and find the min week start date when min week start date > Start_date of the slicer. Same way Max

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

thanks @amitchandak , I don't want to disrupt my current logic of fortnight end date. Any way I can include the min & max date seprately? or perhaps merge it with existing logic?

EVEAdmin
Post Patron
Post Patron

I guess this tutorial will be helpful

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

Top Kudoed Authors