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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Krexx
Helper I
Helper I

If function (True/False) based on date slicer

Hello, i would like to generate an dynamic measure based on an date slicer from an date table.

So if the date slicer if from 01/04/2019 until 31/12/2019 i would expect following output:

Date of birthDynamic Measure Output
01.02.2019false
04.03.2019false
06.05.2019true
07.08.2019true
23.12.2019true


Something like this:

TEST =
VAR EndDate = max(Date[Date])
Var Startdate = min(Date[Date])
VAR Result =
    IF(Table[BirthDate] >= Startdate && Table[BirthDate] <= Enddate, True, False)
Return
Result

Thanks in advance
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Krexx ,

According to my understand , you want to dynamically display True()/False() based on Slicer ,right?

 

Firstly , you need to create a calendar table using :

DateSlicer =

CALENDAR ( "2019/1/1", "2019/12/31" )

Make sure the data type of Date of birth is Date

9.15.4.1.png

Then use the following formula:

Measure =
VAR _maxDate =
    MAX ( 'DateSlicer'[Date] )
VAR _minDate =
    MIN ( 'DateSlicer'[Date] )
RETURN
    IF (
        MAX ( 'DateTable'[Date of birth] ) > _minDate
            && MAX ( 'DateTable'[Date of birth] ) <= _maxDate,
        TRUE (),
        FALSE ()
    )

My visualization looks like this:

9.15.4.2.png

Did I answer your question ? Please mark my reply as solution. Thank you very much.

If not, please upload some insensitive data samples and expected output.

 

Best Regards,

Eyelyn Qin

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Krexx ,

According to my understand , you want to dynamically display True()/False() based on Slicer ,right?

 

Firstly , you need to create a calendar table using :

DateSlicer =

CALENDAR ( "2019/1/1", "2019/12/31" )

Make sure the data type of Date of birth is Date

9.15.4.1.png

Then use the following formula:

Measure =
VAR _maxDate =
    MAX ( 'DateSlicer'[Date] )
VAR _minDate =
    MIN ( 'DateSlicer'[Date] )
RETURN
    IF (
        MAX ( 'DateTable'[Date of birth] ) > _minDate
            && MAX ( 'DateTable'[Date of birth] ) <= _maxDate,
        TRUE (),
        FALSE ()
    )

My visualization looks like this:

9.15.4.2.png

Did I answer your question ? Please mark my reply as solution. Thank you very much.

If not, please upload some insensitive data samples and expected output.

 

Best Regards,

Eyelyn Qin

amitchandak
Super User
Super User

@Krexx ,

Try like this

count(Table[BirthDate] )+0

 

As you selected a range as table filter might not go away.

Create a date table from Mon to max brith dates and join ith with table . And plot this measure with date from date table

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions

Appreciate your Kudos.

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

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.