Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have data for a weekly event, held on the same day each week. My data has a Date, Location & Count field which represents the count of people in attendance for that week/date for a particular location, and the data spans accross 2 years.
I have added columns for year, month, monthname & weeknum.
Please help.
Solved! Go to Solution.
Hi @Anonymous ,
Sorry for late back, you can modify the formula to:
Weekly Change =
VAR _Current =
SUMX (
FILTER (
'Table',
'Table'[WeekNum] = EARLIER ( 'Table'[WeekNum] )
&& 'Table'[Location] = EARLIER ( 'Table'[Location] )
),
'Table'[Count]
)
VAR _Next =
SUMX (
FILTER (
'Table',
'Table'[WeekNum]
= EARLIER ( 'Table'[WeekNum] ) + 1
&& 'Table'[Location] = EARLIER ( 'Table'[Location] )
),
'Table'[Count]
)
RETURN
DIVIDE ( _Next - _Current, _Current )
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you @v-yanjiang-msft that looks pretty clear and straight forward.
What's the difference between finding an average using your measure and simply dropping the Count column in a visual and selecting to summarise it by Average?
Also I know there are always many ways to do what I need so I welcome someone else to provide another approach, for my reference.
Hi @Anonymous ,
My pleasure!
If your data is just the same with my sample, there's no difference. The formula can ensure not be affected by slicer etc.
Best Regards,
Community Support Team _ kalyj
Hi @Anonymous ,
According to your description, I create a sample and add a weeknum column. Date column are saturdays from each week.
Here's my solution.
1.Average attendance per week for each location. Create a measure.
Average Count =
AVERAGEX (
FILTER ( ALL ( 'Table' ), 'Table'[Location] = MAX ( 'Table'[Location] ) ),
'Table'[Count]
)
Put Location and the measure in a visual, get the result.
2.Attendance change week by week. Create a calculated column.
Weekly Change =
VAR _Current =
SUMX (
FILTER ( 'Table', 'Table'[WeekNum] = EARLIER ( 'Table'[WeekNum] ) ),
'Table'[Count]
)
VAR _Next =
SUMX (
FILTER ( 'Table', 'Table'[WeekNum] = EARLIER ( 'Table'[WeekNum] ) + 1 ),
'Table'[Count]
)
RETURN
DIVIDE ( _Next - _Current, _Current )
Get the result.
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi again, this is good and i have added this in, however each location needs to have their own week 1,2,3 etc, like this.
Date | location | count | weeknum |
1/1/22 | A | 9 | 1 |
1/1/22 | B | 18 | 1 |
1/1/22 | C | 10 | 1 |
1/8/22 | A | 6 | 2 |
1/8/22 | B | 20 | 2 |
1/8/22 | C | 20 | 2 |
1/15/22 | A | 8 | 3 |
1/15/22 | B | 5 | 3 |
1/15/22 | C | 9 | 3 |
1/22/22 | A | 8 | 4 |
1/22/22 | B | 15 | 4 |
1/22/22 | C | 11 | 4 |
1/29/22 | A | 15 | 5 |
1/29/22 | B | 5 | 5 |
1/29/22 | C | 20 | 5 |
What adjustments are needed to work with this data structure?
Hi @Anonymous ,
Sorry for late back, you can modify the formula to:
Weekly Change =
VAR _Current =
SUMX (
FILTER (
'Table',
'Table'[WeekNum] = EARLIER ( 'Table'[WeekNum] )
&& 'Table'[Location] = EARLIER ( 'Table'[Location] )
),
'Table'[Count]
)
VAR _Next =
SUMX (
FILTER (
'Table',
'Table'[WeekNum]
= EARLIER ( 'Table'[WeekNum] ) + 1
&& 'Table'[Location] = EARLIER ( 'Table'[Location] )
),
'Table'[Count]
)
RETURN
DIVIDE ( _Next - _Current, _Current )
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
80 | |
76 | |
61 | |
36 | |
32 |
User | Count |
---|---|
91 | |
60 | |
59 | |
49 | |
45 |