Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I have data like:
Name, 2024-01, 2024-02, 2024-03, etc to 2025-01
Customer a, 5,5,10,10 etc
Customer b, 10,11,11,12 etc
Customer c, 0,0,0,0....7,7 as they only have values for last 2 months
I'd like a column added that gives moving average over as many months as there is data to indicate a trend
Is that possible?
Solved! Go to Solution.
hello @RamblingFire
i might be misunderstood but please check if this accomodate your need.
1. i assumed your table looks like this based on your description above.
2. unpivot the table and rename the header if needed.
3. create a new measure with following DAX
Average =
var _Name = SELECTEDVALUE('Table'[Name])
Return
AVERAGEX(
FILTER(
ALL('Table'),
'Table'[Name]=_Name&&
'Table'[Date]<=MAX('Table'[Date])
),
'Table'[Value]
)
hello @RamblingFire
i might be misunderstood but please check if this accomodate your need.
1. i assumed your table looks like this based on your description above.
2. unpivot the table and rename the header if needed.
3. create a new measure with following DAX
Average =
var _Name = SELECTEDVALUE('Table'[Name])
Return
AVERAGEX(
FILTER(
ALL('Table'),
'Table'[Name]=_Name&&
'Table'[Date]<=MAX('Table'[Date])
),
'Table'[Value]
)
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
28 | |
12 | |
10 | |
10 | |
6 |