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
Joost
Regular Visitor

Accumulated values with calendar

Hi,

 

I am having a slight problem and was hoping someone could help me.

I want to display the costs of projects so far along with the time they occured in. The projects have a start and end date. Thus, I made a calendar table:

 

Calendar = CALENDAR(MIN('P2Project-FULL'[Start date]),DATEVALUE("31-May-2017"))

 

I then calculate the costs with the following measure:

Actuals period = CALCULATE(SUM('P2Project-FULL'[Costs Actual]),FILTER('P2Project-FULL','P2Project-FULL'[Start date] <= MAX('Calendar'[Date])))

The total amount is how I want to have it as it coressponds with the total amount of the colum [Costs Actual] from the table P2Project-Full. 

 

The problem I am getting however is that when I put them in a line and clustered chart, the amounts of each year add up to the total (in 2017). Let me show you what I mean with a picture:

1.png

 

 As you can see the values are accumalating for the green bars, as now for instance 2016 = 2016 + 2015 + 2014. 

What I want is that the year only counts for that year, so 2016 only counts the values of 2016 etc. 

 

Can anyone help me fix this? 

 

1 ACCEPTED SOLUTION

@Joost i could be wrong but it looks like you linking to the max date in your calendar which might not work, since you need it to take start and end date of the project correct?

 

a few questions 

1. do you have a date table

2. what date in the date in the date table linked to in your data?

 

post pic of your relationship view please 

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
vanessafvg
Super User
Super User

@Joost

 

your calculate is a cummulative figure  ie. 

P2Project-FULL'[Start date] <= MAX('Calendar'[Date])))

 from you will need to get the correct end date to not cummulate





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




@vanessafvg Could you elaborate? I don't really understand what you mean.

@Joost i could be wrong but it looks like you linking to the max date in your calendar which might not work, since you need it to take start and end date of the project correct?

 

a few questions 

1. do you have a date table

2. what date in the date in the date table linked to in your data?

 

post pic of your relationship view please 

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Thank you very much, I completely missed the relationship between the dates of the two tables, oops. 

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.