Showing results for 
Search instead for 
Did you mean: 
Helper IV
Helper IV

Total aggregations are not adding up correctly for calculated measure.

2019-12-29_1250.pngEach academic year spans across about 18 months worth of data because applications starts to be accepted as early as 10 months before school starts. For example, academic year 2019-2020, applications start to be accepted as early as November 2018. Because academic year is not a regular 12 months year, the best way I found to align the dates to make comparison is creating the date adj, which is the result of the following calculation:  



apptime adj = if [academic year]="2016-2017" then Date.AddDays([apptime],1095) else if [academic year]="2017-2018" then Date.AddDays([apptime],730) else if [academic year]="2018-2019" then Date.AddDays([apptime],365) else [apptime]  



In order to compare previous year data to the current time, I first find the max current application date (not apptime adj):



Newest Date = MAX(application_count[apptime])




Then, filter application counts before the current time from previous years:




Total Apps Adj = if(application_count[apptime adj]<application_count[Newest Date],application_count[Total Apps],BLANK())




This returns the desired result, but the totals are off. Thanks in advance for you help. 

Community Support
Community Support



You may use ISINSCOPE to add a measure.

Measure 2 =
IF (
    ISINSCOPE ( 'Dates Adj'[Month Year] ),
    SUM ( application_count[Total Apps Adj] ),
    SUM ( application_count[Total Apps] )


Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-chuncz-msft thanks for your help. I applied your solution, but it did not change anything.

Could you show me the solution in the actual .pbix file? 



Helpful resources

PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

Get Ready for Power BI Dev Camp

Power BI Dev Camp - September 30th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors