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
Heena_9980400
Helper III
Helper III

How to get last five days date in button.

Hi Experts,

 

I have a requirement where we are using a matrix for showing data and need to build a button(Last 5 days date) and when we click on that it should show only the last 5 days' data in the matrix,

For particular requirements on how to build it, Need your input and suggestions

 

Thanks in advance,

 

Regards,

Hk

6 REPLIES 6
krishb1414
Helper III
Helper III

Hi @Heena_9980400 , You can acheive with help of Bookmarks. see images below, Please refer that.

If it works please accept my solution.

Spoiler
Screenshot 2023-04-11 130514.pngScreenshot 2023-04-11 130405.png




olgad
Super User
Super User

demo-5last days.pbix


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime
olgad
Super User
Super User

Hi, here is the workaround you can use:

 

1) Take a bookmark of the page, then on your matrix/table under Filter on visual set Date Filter to TOP N Bottom 5 latest date. 
Create another bookmark named 5 last days. Go to insert button-bookmark navigator and here you are, having 2 buttons switching between all and last 5 dates. 

olgad_0-1680783208015.png

The second workaround is just to create 2 measures, Sum Sales and Sum Sales for the last 5 days and then add filed parameter with thos 2 measures as a field. This way you can show both values at the same time or single select from the slicer what to show all sales or last 5 days sales. 


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

Hi @olgad ,

 

Thanks for your input,

only when I click on the last 5 days it should show the last 5 days' date and the remaining it will have all dates and data.

I am just a little bit confused here can you please guide me go through !!

 

Thanks in advance!!

 

Hi, let me know where you get confused so i can explain it in a different way.

1) You have you all dates all data-take a bookmark

2) Then on the page set up a date filter for 5 last days-take a bookmark

Insert the bookmarks on the page-insert button -bookmark navigator. Click on the first bookmark you have all data click on the second you have 5 days


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

Hi @olgad ,

 

If you have any screenshots or dump pbix, please can you share with me. I just want to know for date how your keeping bookmark.

 

Thanks in advance,

Hk

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.