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
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
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.