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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ryan_b_fiting
Post Patron
Post Patron

Count future values regardless of slicer range

Hello Community - 

 

I have an issue I am facing regarding the measuring of future values.  I have a date slicer on my report page (from a calendar table that is then joined to other tables)

Date Slicer.PNG

Despite that filter which i needed for many of the metrics, I also have patients that book appointments into the future which I will see the appointments with a future appointment date on them (ie 5/3/2022 6/3/2022 etc).

I need to be able to calculate all appointments that are within the slicer range, but then also include ALL appointments that have a future date associated with them.  So my calculation currently is:

Booked Appointments = CALCULATE(
    '1-Measures'[Appointments],
       ALL(Date_Table) )

but this gives me all appointments that are prior to my date slicer range as well.  What filter context do I need to put on my measure to get it to include all Appointments within the sliced range AND BEYOND?

Thank You Community

Ryan

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@ryan_b_fiting 

Try something like this.

Booked Appointments =
VAR _MinDate =
    MIN ( Date_Table[Date] )
RETURN
    CALCULATE (
        '1-Measures'[Appointments],
        ALL ( Date_Table ),
        Date_Table[Date] >= _MinDate
    )

View solution in original post

3 REPLIES 3
jdbuchanan71
Super User
Super User

@ryan_b_fiting 

Try something like this.

Booked Appointments =
VAR _MinDate =
    MIN ( Date_Table[Date] )
RETURN
    CALCULATE (
        '1-Measures'[Appointments],
        ALL ( Date_Table ),
        Date_Table[Date] >= _MinDate
    )

Thanks @jdbuchanan71 this worked perfect.

Greg_Deckler
Super User
Super User

@ryan_b_fiting Use MAX to get your max date range. Then include > that date in your CALCULATE as a filter statement along with your ALL.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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