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
Jasonvl
Frequent Visitor

Filter by today or selected date on the same page?

Hi,

 

I have a dataset that updates every day and the values change daily. I'd like the users via the report page only, to be able to choose to show today's data or go back historically and look at another date? I can achieve this using two different versions of the same report but not one report because the filters conflict with each other. Is there a way around this please?

 

So to clarify ideally there should be a single calender dropdown (like the ones that appear in the date filters but one date box instead of a start and end date box) which defaults to today's date everytime the data is refreshed and then the user can just choose a historical date if they want to see a snapshot of the data in the past.

 

Regards, Jason.

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

Hi @Jasonvl 

As amitchandak suggested, you could use a relative slicer to show today's data by default, then select any other date range from relative slicer, or change to other type of slicer to select some specific date points.

 

Or you could add measure into page level filter or visual level filter to filter the page or visual to show specific data.

for example, if there is no selection from the slicer, the table shows today's data by default,

if any selection is chosen from the slicer, the table shows data as the selected data.

Capture5.JPGCapture6.JPGCapture7.JPG

is any date selected = IF(ISFILTERED('Table 2'[Date]),1,0)

show which date =
IF (
    [is any date selected] = 0,
    IF (
        MAX ( Query1[new date] )
            = TODAY (),
        1,
        0
    ),
    IF (
        MAX ( Query1[new date] )
            <= MAX ( 'Table 2'[Date] )
            && MAX ( Query1[new date] )
                >= MIN ( 'Table 2'[Date] ),
        1,
        0
    )
)

"Table(2)" has no relationship with other tables.

[Date] slicer is from "Table(2)".

 

Best Regards
Maggie
Community Support Team _ Maggie Li
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-juanli-msft
Community Support
Community Support

Hi @Jasonvl 

As amitchandak suggested, you could use a relative slicer to show today's data by default, then select any other date range from relative slicer, or change to other type of slicer to select some specific date points.

 

Or you could add measure into page level filter or visual level filter to filter the page or visual to show specific data.

for example, if there is no selection from the slicer, the table shows today's data by default,

if any selection is chosen from the slicer, the table shows data as the selected data.

Capture5.JPGCapture6.JPGCapture7.JPG

is any date selected = IF(ISFILTERED('Table 2'[Date]),1,0)

show which date =
IF (
    [is any date selected] = 0,
    IF (
        MAX ( Query1[new date] )
            = TODAY (),
        1,
        0
    ),
    IF (
        MAX ( Query1[new date] )
            <= MAX ( 'Table 2'[Date] )
            && MAX ( Query1[new date] )
                >= MIN ( 'Table 2'[Date] ),
        1,
        0
    )
)

"Table(2)" has no relationship with other tables.

[Date] slicer is from "Table(2)".

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Jasonvl , you can something a column like this

Is Today = if('Date'[Date]=TODAY(),"Today",[Date]&"")

 

Date needs to be sort column of this and you can select today.

https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column

You can explore relative date slicer

https://docs.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range

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.