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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Using Selected Date in Measure

Hi All, 

 

I am looking to use a slicer to select a date in the future to view how many projects are categorized as "Done", "In Progress", or "Scheduled". My Current DAX looks like:

 

Status = 

VAR CurrentDate = Today()

RETURN

SWITCH(

TRUE(),
AND(CurrentDate >= MAX(timeline[Start Date]), CurrentDate <= MAX(timeline[End Date])), "In Progress",

AND(CurrentDate >= MAX(timeline[Start Date]), CurrentDate >= MAX(timeline[End Date])), "Done",

"Scheduled")

 

I am looking to use the value from a Date Slicer but SELECTEDVALUE(DATE[DATE]) does not seem to work. 

 

However using a random date in the future like below gets my expected output: 

Status = 

VAR CurrentDate = DATEVALUE("10/01/2025")

RETURN

SWITCH(

TRUE(),
AND(CurrentDate >= MAX(timeline[Start Date]), CurrentDate <= MAX(timeline[End Date])), "In Progress",

AND(CurrentDate >= MAX(timeline[Start Date]), CurrentDate >= MAX(timeline[End Date])), "Done",

"Scheduled")

 

 I am looking to get a user input for VAR CurrentDate.

 

Thank you!

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

Hi @Anonymous ,

 

This is my test table:

vyadongfmsft_0-1668504133318.png

 

Date table:

vyadongfmsft_0-1668751122633.png

 

 

Create a measure:

 

Status = 
VAR MINDate =
    MIN('Table'[Date])
VAR MAXDate = 
    MAX('Table'[Date])
RETURN
    SWITCH (
        TRUE (),
        MINDate <= MAX(timeline[Start Date])
            && MAXDate >= MAX(timeline[End Date]), "In Progress",
        MINDate >= MAX(timeline[Start Date])
            && MAXDate >= MAX(timeline[End Date]), "Done",
        "Scheduled"
    )

 

 

Create a slicer form date table and create a table visual from timeline table:

vyadongfmsft_3-1668751245794.png

 

 

 You can select a date in the future to view how many projects are categorized as "Done", "In Progress", or "Scheduled":

vyadongfmsft_4-1668751269882.png

vyadongfmsft_5-1668751314048.png

 

 

Best regards,

Yadong Fang

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-yadongf-msft
Community Support
Community Support

Hi @Anonymous ,

 

This is my test table:

vyadongfmsft_0-1668504133318.png

 

Date table:

vyadongfmsft_0-1668751122633.png

 

 

Create a measure:

 

Status = 
VAR MINDate =
    MIN('Table'[Date])
VAR MAXDate = 
    MAX('Table'[Date])
RETURN
    SWITCH (
        TRUE (),
        MINDate <= MAX(timeline[Start Date])
            && MAXDate >= MAX(timeline[End Date]), "In Progress",
        MINDate >= MAX(timeline[Start Date])
            && MAXDate >= MAX(timeline[End Date]), "Done",
        "Scheduled"
    )

 

 

Create a slicer form date table and create a table visual from timeline table:

vyadongfmsft_3-1668751245794.png

 

 

 You can select a date in the future to view how many projects are categorized as "Done", "In Progress", or "Scheduled":

vyadongfmsft_4-1668751269882.png

vyadongfmsft_5-1668751314048.png

 

 

Best regards,

Yadong Fang

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

djurecic
Super User
Super User

Hi @Anonymous ,

 The slicer may be filtering out any dates other than the selected date, so you won't get any results where the date is < or >. 

You can use the All function on the timeline table to escape the slicer filtering.

https://learn.microsoft.com/en-us/dax/all-function-dax

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.