Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

how to show latest data

Hi All,

 

I have 5 yrs of sales data till date and I have a date table. What I need is if I open a report (refreshed today) on Power BI Service, it should show the latest data (past 30 days) filtered by Date fiter.

For ex: If I open a report refreshed today (12/03/2021), then it should automatically filter the between range date filter from 10/02/2020 to 12/03/2020. But I also need the old data (ie dates before 10/02/2020). Old data should not be removed.

Can I achieve this using query parameters? 

How to do this ?

 

 

Thanks,

  • Hi, Anonymous 

    According to your description, you want to make your report only display the data of the most recent 30 days, I think you can simply achieve this using Measure and report filter or visual filter in the Power BI, you can try my steps:

    This is my test data: a calendar table

     

    I created a measure like this:

     

    Flag =
    
    IF(
    
        MAX('Date'[Date])<=TODAY()&&
    
        MAX('Date'[Date])>=TODAY()-30,1,0)

     

    Then apply a filter to the table chart like this:

     

    What’s more, here’s an easier way to achieve this, you can use the “Relative date” type of filter like this, just click on the blank space in your report page, and set the date filter like this:

     

    And you can get what you want.

    My test pbix file is attached here

    If you still have a problem, you can post some sample data(without sensitive data) and your expected result.

    How to Get Your Question Answered Quickly 

     

    Best Regards,

    Community Support Team _Robert Qin

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

2 Replies

  • v-robertq-msft's avatar
    v-robertq-msft
    Icon for Community Support rankCommunity Support

    Hi, Anonymous 

    According to your description, you want to make your report only display the data of the most recent 30 days, I think you can simply achieve this using Measure and report filter or visual filter in the Power BI, you can try my steps:

    This is my test data: a calendar table

     

    I created a measure like this:

     

    Flag =
    
    IF(
    
        MAX('Date'[Date])<=TODAY()&&
    
        MAX('Date'[Date])>=TODAY()-30,1,0)

     

    Then apply a filter to the table chart like this:

     

    What’s more, here’s an easier way to achieve this, you can use the “Relative date” type of filter like this, just click on the blank space in your report page, and set the date filter like this:

     

    And you can get what you want.

    My test pbix file is attached here

    If you still have a problem, you can post some sample data(without sensitive data) and your expected result.

    How to Get Your Question Answered Quickly 

     

    Best Regards,

    Community Support Team _Robert Qin

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