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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

Set report slicer from latest values of table

Hello everyone!

 

I need some help on creating a date slicer for my report. I have a script that runs every weekend and I extract some data, which I then put on a graph. Is there a way to show only the data from the latest run? I am thinking of creating a table with three columns: Run ID, Start Date and End Date, and be able to select whichever run ID I want and the slicer automatically sets the start and end date.

 

Do you think that that's possible? Below I show the graph and the table with the original data.

 

Run Data.pngTime Data.pnggraph.png

 

Thank you!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous  and @v-xicai 

 

Thank you both for answering! I managed to figure out a solution. On the txt files that I get the data from, I can write the start and end date so I just get those dates from there and put them on the a table. Then I created a measure to get the values between MAX(Latest start date) and MAX(Latest end date), and that was it!! I got the result I wanted!

 

So again thank you both for your responses!

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous  and @v-xicai 

 

Thank you both for answering! I managed to figure out a solution. On the txt files that I get the data from, I can write the start and end date so I just get those dates from there and put them on the a table. Then I created a measure to get the values between MAX(Latest start date) and MAX(Latest end date), and that was it!! I got the result I wanted!

 

So again thank you both for your responses!

v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You may  create a column like DAX below to get latest Date of the data table, then drag it into Page level filter or Report level filter, setting it as the latest date. Or just drag the [DateTime] into Filter pane, find and tick the latest date.

 

LatestDate = MAX(Sales[DateTime])

108.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards,

Amy 

 

Community Support Team _ Amy

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

Anonymous
Not applicable

Hi @Anonymous ,

 

As far as I know, for now it's impossible to make the slicer to select the max value as default.

 

But I have two workarounds, they may help you, but also have limitations.

 

1. If you are using SQL query to load your data, you can set a flag in your query, like:

case when timestamp = (select Max(timestamp) from your_table) then yes else no end as flag.

 

Then you can add the flag to page filter, check "yes", after that while you update your data, it will show the latest timestamp automatically.

 

2. If you can't change the query or you are using other data sources, you can try to do the same thing in Power Query Editor.

For example, you can sort your data by the timestamp column by desc, then add an index column from 1.

And the same operation as above. Put the index column to page filter, select 1 as default.

 

I hope it can help you.

Thanks.

Aiolos Zhao

Anonymous
Not applicable

Hi @Anonymous 

 

Thank you for your reply! In my case I have txt files. 

 

I get what you mean and it's an interesting uproach! I shall try it out and hopefully it'll work!

 

Thank you!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.