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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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

@Anonymous , 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 @Anonymous ,

 

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

Anonymous
Not applicable

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

@Anonymous , 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

Anonymous
Not applicable

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

@Anonymous 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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

August Carousel

Fabric Community Update - August 2024

Find out what's new and trending in the Fabric Community.