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
Pikachu-Power
Post Prodigy
Post Prodigy

TOTALYTD without restriction to the years.

hello,

how can i add up values i an column date by date? example:

 

Date             Value    Result

31.12.2019    1          1

01.01.2020    5          6

02.01.2020    7          13

 

Looking for something like TOTALYTD without restriction to the years.

 

 

 

 

1 ACCEPTED SOLUTION

@Pikachu-Power 

Add column with this formula:

SumColumn = 

CALCULATE(
SUM(Data1[      Value  ]),
FILTER(ALL(Data1),
Data1[Date      ]<=EARLIER(Data1[Date      ])
)
)
 
 

If you are satisfied with my answer, please mark it as a solution so others can easily find it.

Don't forget to give KUDOS ? to replies that help answer your questions


Subscribe to ExcelFort: Learn Power BI, Power Query and Excel
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

9 REPLIES 9
amitchandak
Super User
Super User

@Pikachu-Power , refer to these examples. Use date table

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(date,date[date] <=maxx(date,date[date])))
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(date,date[date] <=max(Sales[Sales Date])))

 

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...


Appreciate your Kudos.

Both formula dont work. I use count instead of sum. but that shouldnt be the problem.

@Pikachu-Power , Looking at data it should be sum, not count

strange. tried it also with sum. same results. no sum or whole sum.

@Pikachu-Power 

Add column with this formula:

SumColumn = 

CALCULATE(
SUM(Data1[      Value  ]),
FILTER(ALL(Data1),
Data1[Date      ]<=EARLIER(Data1[Date      ])
)
)
 
 

If you are satisfied with my answer, please mark it as a solution so others can easily find it.

Don't forget to give KUDOS ? to replies that help answer your questions


Subscribe to ExcelFort: Learn Power BI, Power Query and Excel
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

@Pikachu-Power 

I assumed you have a single table as per your sample data, you have to modify the formula as per your data model.

If you are satisfied with my answer, please mark it as a solution so others can easily find it.

Don't forget to give KUDOS ? to replies that help answer your questions


Subscribe to ExcelFort: Learn Power BI, Power Query and Excel

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Ok it works now. I think in the formula of amitchandak an ALL was missing. and i had a format error.

@Pikachu-Power 

Great!

If you are satisfied with my answer, please mark it as a solution so others can easily find it.

Don't forget to give KUDOS ? to replies that help answer your questions


Subscribe to ExcelFort: Learn Power BI, Power Query and Excel

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Dont work. Are there some conditions i have to fulfill? for example concerning the datamodel?

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.