Forum Discussion
erikriesenberg
4 years agoFrequent Visitor
YoY% change calculation not returning correct values
I have a calculation returning the total delivery fees we've collected divided by the number of enrollments during any given period of time. Delivery Fees Per Enrollment = DIVIDE( SUM('...
sm_talha
4 years agoResolver II
Can you try Returning the __PREV_YEAR variable from your orginal formula and see if it is 233 for the month in discussion?
erikriesenberg
4 years agoFrequent Visitor
Yes, I Returned __PREV_YEAR and get 233.
- erikriesenberg4 years agoFrequent Visitor
I think the problem that I have is that the [Delivery Fees Per Enrollment] calculation isn't year specific.
Delivery Fees Per Enrollment =DIVIDE(SUM('VDP Enrollments'[Delivery Fees]),COUNTA('VDP Enrollments'[Class]))
So when it tries to run this part of the DAX
DIVIDE( _average - __PREV_YEAR, __PREV_YEAR)the -average is pulling the Delivery Fees for all years
I tried adding a variable for __CURR_YEAR, but that doesn't seem to have fixed it.Delivery Fees Per Enrollment YoY% =IF(ISFILTERED('Dates'[Date]),ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),VAR __CURR_YEAR =CALCULATE([Delivery Fees Per Enrollment],DATEADD('Dates'[Date].[Date], 0, YEAR))VAR __PREV_YEAR =CALCULATE([Delivery Fees Per Enrollment],DATEADD('Dates'[Date].[Date], -1, YEAR))RETURNDIVIDE(__CURR_YEAR - __PREV_YEAR, __PREV_YEAR))