cancel
Showing results for
Did you mean:
Helper III

## Same Store Sales Growth in Calculation Groups?

Hi all, working in Tabular Editor, I have created some calculation groups that measure YTD/MTD Year over Year growth %, but I would like to only calculate this for locations that had sales in the prior period/year. We've added many new locations in the past year and the growth numbers are obviously inflated because we've added 40 locations in the past 6 months.

Here's what I am using today for my QTD calculation measure.

Placeholder =
VAR CYQTD =
CALCULATE (
SELECTEDMEASURE (),
CALCULATETABLE ( DATESQTD ( 'Calendar'[Date] ), 'Calendar'[IsPast] = TRUE () )
)
VAR PYQTD =
CALCULATE (
SELECTEDMEASURE (),
CALCULATETABLE (
DATEADD ( DATESQTD ( 'Calendar'[Date] )-1YEAR ),
'Calendar'[IsPast] = TRUE ()
)
)
VAR YOYQTD = ( CYQTD - PYQTD )
RETURN
DIVIDE ( YOYQTDPYQTD )

3 REPLIES 3
Super User

@sublog , Assuming you have location[location] or table[location]

Change in your formula at the end

VAR YOYQTD = Sumx(values(Location[Location]), if(not(isblank(PYQTD)), ( CYQTD - PYQTD ), blank()))
RETURN
DIVIDE ( YOYQTD, PYQTD )

Helper III

Okay, I replaced the VAR YOYQTD = ( CYQTD - PYQTD ) section with what you gave me above, but the numbers are not correct? I assume you meant location as the table that contains my locations?

Helper III

Thank you, I will check on this and report back!

Announcements

#### 2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

#### Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

#### Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

#### Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.

Top Solution Authors
Top Kudoed Authors