Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
I have the following measure, which works *almost* perfectly for what I need:
You could try something like
Traffic Cnt YOY% =
var currentLocations = CALCULATETABLE( VALUES('Table'[location]), [Traffic Count] > 0 )
var lastYearLocations = CALCULATETABLE( VALUES('Table'[location]), [Traffic Count] > 0, DATEADD('Date'[Date], -1, YEAR) )
var result = CALCULATE(
var _PREV_YEAR = CALCULATE([Traffic Cnt Trend], DATEADD('Date'[Date], -1, YEAR))
return DIVIDE( [Traffic Cnt Trend] - _PREV_YEAR, PREV_YEAR),
TREATAS( INTERSECT( currentLocations, lastYearLocations), 'Table'[location] )
)
return result
Hi there, thanks for replying. I've tried to implement this solution and it says "A function 'PLACEHOLDER' has been used in a True/False expression that is used as a table filter expression. This is not allowed."
I was receiving this error previously when messing around with solutions I could come up with - I think it's mad that I'm trying to do the "[Traffic Cnt] >0" filter.
I think the overall principle of using the intersection between this year and last year will still work, we just need to get those values slightly differently. Try replacing the lines for this year and last year with
var currentYearSummaryTable = ADDCOLUMNS( SUMMARIZE('Table', 'Table'[location]), "@traffic", CALCULATE([Traffic count]) )
var lastYearSummaryTable = ADDCOLUMNS( SUMMARIZE('Table', 'Table'[location]), "@traffic", CALCULATE([Traffic count], DATEADD('Date'[Date], -1, YEAR)) )
var currentLocations = SELECTCOLUMNS( FILTER( currentYearSummaryTable, [@traffic] > 0), "location", [location])
var lastYearLocations = SELECTCOLUMNS( FILTER( lastYearSummaryTable, [@traffic] > 0), "location", [location])
Traffic Cnt YoY% =
VAR __PREV_YEAR = CALCULATE([Traffic Cnt Trend], DATEADD('Date'[Date], -1, YEAR))
RETURN
if([Traffic Cnt Trend] <> 0 && __PREV_YEAR <> 0, DIVIDE([Traffic Cnt Trend] - __PREV_YEAR, __PREV_YEAR), blank())
Thanks for replying, I appreciate your help here. When I try to implement your solution it still factors in locations where Traffic Cnt Prev Year = 0 when it's aggregated up into a higher level in the hierarchy.