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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Daviejoe
Memorable Member
Memorable Member

Dynamic Date in Calculate

Hi,

 

My measure below gives me the end of total for last year, which is what i need for now as the first iteration of my report will have a static front page.

 

However, I'm sure I'll get asked to make my calculation dynamic.  How do I make my DATESYTD(ENDOFYEAR(DATEADD('Date'[Date], -1, YEAR )), "31/12" section of my code so it reflects one previous to the year selected in the Date Filter?

 

Measure =
CALCULATE (
    COUNTROWS ( MyTable ),
       FILTER ( MyTable, MyTable[MyColumn] = "Yes" ),
       DATESYTD(ENDOFYEAR(DATEADD('Date'[Date], -1, YEAR )), "31/12")
)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




5 REPLIES 5

Hi @stevedep 

 

thanks for the link, really useful.  Which part, or parts, of my posting did you feel I could improve?

 

Thanks

 

David





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




What is the table structure (which columns)?
Which tables used (Date Dimension)?

How are they related?

Sample data,

What is your outcome on the sample data and what did you expect,

Your formula.

Preferably a pbi file with sample data, so we can make it work in the sample file and you will have no issues replicating it in your final solution. 

Ha, you're right.  My post was very light on detail.  Thanks for pointing this out and making it clear.

 

I'll update the post later with more information.

 

Thanks again, appreciated.

 

David





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks, looking forward to help with the updated question. 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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