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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Before or Equal to Today (for this year and last year)

Hello -  I am trying to achieve a formula that will only show values up to (or before) today's day.   But not only for this year, for last year as well....so up to same day last year.  

 

The formula below works fine for hiding future date periods for this year.   But I need a formula that also would hide the equivalent future dates (but from last year)....if that makes sense.    Essentially a year-over-year  (but not cumulative), and only showing the equivalent time periods.   So in other words, the column chart below shows 2021 (orange) up to the current date.   I want the blue (2020) bars to also stop based on the same date, but last year.   Any help is appreciated.  

 

Before or Equal to Today = IF('Date Table'[Date]<=TODAY(),TRUE(),FALSE())

 

texmexdragon_0-1614172914643.png

 

4 REPLIES 4
v-yiruan-msft
Community Support
Community Support

Hi @Anonymous ,

You can refer the content in the following links to achieve it.

Using SAMEPERIODLASTYEAR To Compare The Difference Between This Year & Last Year

This year vs Last year Calculation in Power BI using DAX

Calculate SAMEPERIODLASTYEAR for Partial Year

If the above ones are not applicable for your scenario, please provide some sample data and expected result with sample or screenshot(exclude sensitive data). Thank you.

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
VijayP
Super User
Super User

@Anonymous 

You need to create another measure LY count using SAMEPERIODLASTYEAR , then Create another measure LY As on Date using DATESYTD and you will get  2 values.! Hope this helps!

 




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


VijayP
Super User
Super User

@Anonymous 

It is better use YTD ( DATESYTD) to show the value till date




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Anonymous
Not applicable

@VijayP   How to apply that in this context?   If I apply DATESYTD less than today, it will give me everything less than today which is not what I need.   I need both years, this year and last year, to be filtered up until the same period of time  (i.e.  Feb 24 2020   and  Feb 24 2021) 

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

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