The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi,
I would like to find a rolling sum for three years for every colour provided.
Solved! Go to Solution.
hi @Anonymous
try to plot a visual with year and colour columns, and a measure like:
3YColourSum =
VAR _year = MAX(TableName[year])
RETURN
SUMX(
FILTER(
ALL(TableName),
TableName[Colour] = MAX(TableName[Colour])
&&TableName[Year] IN {_year, _year-1, _year-2}
),
TableName[Sales]
)
it worked like:
Thank you! It worked well.
hi @Anonymous
try to plot a visual with year and colour columns, and a measure like:
3YColourSum =
VAR _year = MAX(TableName[year])
RETURN
SUMX(
FILTER(
ALL(TableName),
TableName[Colour] = MAX(TableName[Colour])
&&TableName[Year] IN {_year, _year-1, _year-2}
),
TableName[Sales]
)
it worked like:
User | Count |
---|---|
15 | |
8 | |
6 | |
6 | |
6 |
User | Count |
---|---|
23 | |
14 | |
13 | |
8 | |
8 |