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
Anonymous
Not applicable

Filter out data by dates till yesterday

Hello Powerbi Developers,

I am having one requirement.

I am having date column in which data is for whole year, but we want to show dynamically with help of Today() -1 function.

eg today is 11/10/22 i want to show data in dashboard till 10/10/22.

So how can we implement it.

Please help me out here on above issues/blockers.

Regards,

1 ACCEPTED SOLUTION

@SgtSnowman , You need to apply measure as visual level filter. Please refer the attached PBIX.

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

8 REPLIES 8
Aburar_123
Resolver IV
Resolver IV

Hi @SgtSnowman ,

 

Please write the measure like below and place it in the visual level filter of the slicer

 

uptoTodayFlag = if(MAX(Date_Dim[Date])<=TODAY(),1,0)
Aburar_123_0-1665483650391.png

 

Samarth_18
Community Champion
Community Champion

Hi @Anonymous ,

 

You can create a measure as below and use it as filter on the visuals you want to apply this filter.

 

Measure = 
IF ( MAX ( 'Table'[Date] ) <= TODAY () - 1, 1, 0 )

Samarth_18_0-1665471750420.png

 

Thanks,

Samarth

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Anonymous
Not applicable

Not Working !!

 

@Anonymous ,could you please show how you have implemented? or if you could share your PBIX after removing sesitive data?

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

I have this same question - I have a date table that has dates until the end of the year 2023, but I only want my slicer to show dates up until yesterday. 
I tried this measure but it doesn't accept it?

 

Measure =
IF ( MAX ( 'Dates'[FullDateAlternateKey]) <= TODAY () - 1, 1, 0)
 
Measure help.png

@SgtSnowman , You need to apply measure as visual level filter. Please refer the attached PBIX.

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Ah, that works. Thank you!

 

One final thing, if I may.... I have two tables that each have their own date (in the same format). Is there a way to make one slicer do a filter on dates and pull back the necessary statistics? 

I can share my pbix file if that makes it easier

@SgtSnowman You could create a date table and join your tables to it. Then use date table on slicer. 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

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.