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
Dan84980
Regular Visitor

Yesterday and Today Calculation

Hi I'm pretty new to Power BI and having one clarification

 

I have data as Year,Month,Week,Date in table and created slicers to filter the data in power BI , I need to create 2 filter Yesterday/Today , If user click on Today or Yesterday data should display , I'm aware that user can select year then Month,week,day but i'm trying to avoid as many as user clicks, I want user to get data straight away if he/she clicks on slicer(Yest/today)

 

Thank you in advance, if possible please share documents  for learning power BI 🙂

8 REPLIES 8
DoubleJ
Solution Supplier
Solution Supplier

You could add 2 calculated columns and use these as slicers:

 

IsToday = IF(Table1[Date] = TODAY(),TRUE(),FALSE())
IsYesterday = IF(DATEADD(Table1[Date],1,DAY) = TODAY(),TRUE(),FALSE())

Hope this helps

JJ

 

 

 

Thanks for response, it did works!, but i'm looking something different than this!, Please see below screen shot for reference

 

Image.PNG

 

Can we get  Mutli circle progras  wheel in power BI, Thanks for your help!, Much appreciated

Ok, so you can create a custom column:

 

Slicer =IF(DATEADD(Table1[Date],1;DAY) = TODAY(),"Yesterday",IF(Table1[Date] = TODAY(),"Today","Before Yesterday"))

An then use this as slicer:
Unbenannt.PNG

 

Is this what you are looking for?

 

 

 

 

how can I made slicer like this?

I mean, how to customize the table data and get that slicer as the result?


@DoubleJ wrote:

Ok, so you can create a custom column:

 

Slicer =IF(DATEADD(Table1[Date],1;DAY) = TODAY(),"Yesterday",IF(Table1[Date] = TODAY(),"Today","Before Yesterday"))

An then use this as slicer:
Unbenannt.PNG

 

Is this what you are looking for?

 

 

 

 





 

Excellent it works!, thanks for help!, is it possible to hide before yesterday in slicer?, i need only today and yesterday

 

Thanks for your help!

I haven't got any answer yet!

I'm afraid this is not possible

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.

Top Solution Authors