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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
Syndicate_Admin
Administrator
Administrator

Obtaining date range

Good morning, I have two date filters where in one the Fecha_inicio is selected and in another the Fecha_fin, coming from two different Date tables (Dates and Dates1). I want to get the date range in a column, in which all the days included in this case between 05/12/2020 and 10/12/2020 appear. These are the filters I have:

Alberto99_0-1648197901263.png

And here's what I want to get:

Alberto99_1-1648197933014.png

Thank you very much and greetings!

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi @Syndicate_Admin ,

 

You can try the following methods. Let me give you an example of creating a new table that includes Date1 and Date2.

Table:

Table = CALENDAR(MIN(Date1[Date1]),MAX(Date2[Date2]))

Create another Measure to filter the display date of this table.

Measure =
IF (
    SELECTEDVALUE ( Date1[Date1] ) <= SELECTEDVALUE ( Date2[Date2] ),
    IF (
        SELECTEDVALUE ( 'Table'[Date] ) >= SELECTEDVALUE ( Date1[Date1] )
            && SELECTEDVALUE ( 'Table'[Date] ) <= SELECTEDVALUE ( Date2[Date2] ),
        1,
        0
    ),
    IF (
        SELECTEDVALUE ( 'Table'[Date] ) <= SELECTEDVALUE ( Date1[Date1] )
            && SELECTEDVALUE ( 'Table'[Date] ) >= SELECTEDVALUE ( Date2[Date2] ),
        1,
        0
    )
)

Put Measure in the filter and set it equal to 1.

vzhangti_0-1648538805862.png

Is this the result you expect?

vzhangti_1-1648538862293.pngvzhangti_2-1648538881583.png

 

Best Regards,

Community Support Team _Charlotte

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

5 REPLIES 5
v-zhangti
Community Support
Community Support

Hi @Syndicate_Admin ,

 

You can try the following methods. Let me give you an example of creating a new table that includes Date1 and Date2.

Table:

Table = CALENDAR(MIN(Date1[Date1]),MAX(Date2[Date2]))

Create another Measure to filter the display date of this table.

Measure =
IF (
    SELECTEDVALUE ( Date1[Date1] ) <= SELECTEDVALUE ( Date2[Date2] ),
    IF (
        SELECTEDVALUE ( 'Table'[Date] ) >= SELECTEDVALUE ( Date1[Date1] )
            && SELECTEDVALUE ( 'Table'[Date] ) <= SELECTEDVALUE ( Date2[Date2] ),
        1,
        0
    ),
    IF (
        SELECTEDVALUE ( 'Table'[Date] ) <= SELECTEDVALUE ( Date1[Date1] )
            && SELECTEDVALUE ( 'Table'[Date] ) >= SELECTEDVALUE ( Date2[Date2] ),
        1,
        0
    )
)

Put Measure in the filter and set it equal to 1.

vzhangti_0-1648538805862.png

Is this the result you expect?

vzhangti_1-1648538862293.pngvzhangti_2-1648538881583.png

 

Best Regards,

Community Support Team _Charlotte

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

Good morning, This helped me solve my problem with the date range, the only thing that when trying to show values in that table, it repeats the same value for all days, instead of showing me the corresponding, attached photo. I do not know if it is due to a topic of relationships between the tables or what the problem may be:

Alberto99_0-1655366624405.png

Thanks a lot

Greetings.

Tahreem24
Super User
Super User

@Syndicate_Admin  Create a date table like below:

Date Table = CALENDAR(MIN(Fecha_inicio),MAX(Fecha_fin))

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Good I have intended what you tell me and creates a column the last value of the column Fecha_fin.

Alberto99_0-1648208210384.png

@Syndicate_Admin Only take MIN and MAX. Remove X from both functions.

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

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.