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

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@diogobraga2 

 

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? 

 

2020-01-02_1404.png

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.