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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.