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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
carade97
Frequent Visitor

how to add date picker to filter all graph to 7 latest date

Hello everyone,

i need some help 

my problem is i cant figure it out how to add date picker to filter all graph to show 7 latest date

and if i didnt choose any date all graph will go to default mode that auto show 7 latest date of their data

carade97_0-1687610535717.png

can power bi do this by creating dax function?

 

7 REPLIES 7
carade97
Frequent Visitor

carade97_0-1687671648499.png

here are my excel and pbix file, everyone please help me

-> testbi

 

Ashish_Mathur
Super User
Super User

Hi,

Just to ensure that i have understood your question correctly, here is my interpretation.  If June 20, 2023 is selected in the slicer, then sales of the past 7 days should show up in the column chart i.e. from June 14 - June 20 (each column will be for one day).  If no date is selected in the slicer and assuing that the last date in the sales table is till June 26, then sales of the recent 7 days should show up in the column chart i.e. from June 20 - June 26 (each column will be for one day).

If my understanding is correct, then share some data to work with.  Share data in a format that can be pasted in an MS Excel file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

yes, you are correct

one drive file dear sir this is shared file by one drive

Hi,

Please find attached the PBI file.  I have enabled single select on the dat slicer.  When you select a date in the slicer, the dates on the X-axis will adjust to show 7 days ended the selected date.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

i have tested your file. i do modify the date slicer to be like the picture below but ie ends up in graph will show only 1 date & i want to know why you copied a calendar

carade97_0-1687783872205.png

 

Take some time and study my file carefully again.  If it is working fine on mine, it should work fine on yours as well.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors