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! Learn more

Reply
Anonymous
Not applicable

Data Source change based on slicer

Dear Friends

 

I have two excel file(have same format), one contains data upto last week and other contain data upto this week, i have many visual in my report .

 

i need to analyse report based on last week or this week dynamically

i need to  change data source based on on slicer selection(dynamic) : Last week and This week

 

How can i achieve this

 

data upto this week:

upto this week.JPG

data upto last week:

upto last week.JPG

 

Slicer be like:

slicer.JPG

Thanks

Jyaul

 

 

 

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous 

You can create a custom column to judge the data up to last week and up to this week . Then add a slicer with the custom column. Using this scheme, you can use the slicer to judge the data of last week and this week.

 

Best Regard

Community Support Team _ Ailsa Tao

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

amitchandak
Super User
Super User

@Anonymous , if you have a date based on the selection

 

Measure  =

var _max =  today() + 7-1*WEEKDAY('Date'[Date],2) //this week end 

return

countrows(filter(Table, Table[Date] <=_max))

 

 

Measure  till last weekend =

var _max =  today() + 7-1*WEEKDAY('Date'[Date],2)  -7 //till last week end 

return

countrows(filter(Table, Table[Date] <=_max))

 

Use these measures with other un summarized data

 

Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123
https://www.youtube.com/watch?v=pnAesWxYgJ8

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Dear,

Thanks for your response but i don't have date based column

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.