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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Sándor
New Member

YTD dynamic table in dax

 

Dear All!

I would like to kindly ask for your help.

 
I have created a simple table with the value of 1 for each day. Just to keep it simple.
 
I am calculating the YTD value with the following measure.
YTD = CALCULATE('Measures-table'[Total],DATESYTD(Sheet1[Date]))
 
Sndor_2-1747593567840.png

 

 

Can you please help me how can I achieve a dynamic table, where the first row is always Today and value of Today is the YTD amount from the very beginning?

This is the goal I would like to achieve given today's date is 18.05.2025 and the value cumulated from the very beginning is 18.

 

Sndor_3-1747593780181.png

 

My issue is, no matter what I tried the value for today got always 1, as it was the first day in the range and not the 18th over all.

 

Thank you in advance

Best regards,

Sándor

 

 

 

2 ACCEPTED SOLUTIONS
danextian
Super User
Super User

Hi @Sándor 

 

If you are trying to exclude future dates from showing up in YTD, you can use double calculate. Also, please start using a separate dates/calendar table that's been marked as such.  Set and use date tables in Power BI Desktop

 

YTD Value today = 
VAR _MAX =
    TODAY ()
RETURN
    CALCULATE (
        CALCULATE ( SUM ( 'Table'[Value] ), DATESYTD ( 'Calendar'[Date] ) ),
        KEEPFILTERS ( 'Calendar'[Date] <= _MAX )
    )

danextian_0-1747610055306.png

Please see the attached pbix.

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

maruthisp
Solution Specialist
Solution Specialist

Hi @Sándor ,

I tried to replicate and fix the issue, Please find the attached pbix file for oyur reference.
YTD dynamic table in dax.pbix

Please let me know if you have further questions.

If this reply helped solve your problem, please consider clicking "Accept as Solution" so others can benefit too. And if you found it useful, a quick "Kudos" is always appreciated, thanks! 

 

Best Regards, 

Maruthi 

LinkedIn - http://www.linkedin.com/in/maruthi-siva-prasad/ 

X            -  Maruthi Siva Prasad - (@MaruthiSP) / X



View solution in original post

4 REPLIES 4
maruthisp
Solution Specialist
Solution Specialist

Hi @Sándor ,

I tried to replicate and fix the issue, Please find the attached pbix file for oyur reference.
YTD dynamic table in dax.pbix

Please let me know if you have further questions.

If this reply helped solve your problem, please consider clicking "Accept as Solution" so others can benefit too. And if you found it useful, a quick "Kudos" is always appreciated, thanks! 

 

Best Regards, 

Maruthi 

LinkedIn - http://www.linkedin.com/in/maruthi-siva-prasad/ 

X            -  Maruthi Siva Prasad - (@MaruthiSP) / X



Ashish_Excel
Resolver V
Resolver V

Hi,

Share the download link of the PBI file.

danextian
Super User
Super User

Hi @Sándor 

 

If you are trying to exclude future dates from showing up in YTD, you can use double calculate. Also, please start using a separate dates/calendar table that's been marked as such.  Set and use date tables in Power BI Desktop

 

YTD Value today = 
VAR _MAX =
    TODAY ()
RETURN
    CALCULATE (
        CALCULATE ( SUM ( 'Table'[Value] ), DATESYTD ( 'Calendar'[Date] ) ),
        KEEPFILTERS ( 'Calendar'[Date] <= _MAX )
    )

danextian_0-1747610055306.png

Please see the attached pbix.

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Dear @danextian  @Ashish_Excel!

 

Thank you very much for your help.

It worked well.

 

In the meanwhile I came up with another solution as well.

 

Sndor_1-1747642162407.png

 

@danextian I am using a different data table in my main model. I just wanted to make the explanation simple.

 

Thank you

Br

S

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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