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.
I have a graph that using a relative date filter looks at the last 12 months.
Is it possible to create a cumulative count that uses the same relative date filter, rather than including previous month totals or using a fixed date filter which will require changing each month?
i.e. not this
Solved! Go to Solution.
Please try
Cumulative Total =
VAR CurrentDate =
MAX ( 'Calendar'[Date] )
VAR FirstDateWithData =
CALCULATE ( MIN ( 'Outcome'[Date] ), REMOVEFILTERS () )
RETURN
CALCULATE (
COUNT ( 'Outcome'[OutcomeID] ),
'Calendar'[Date] >= FirstDateWithData,
'Calendar'[Date] <= CurrentDate
)
Hi @sparker22
Please try
Cumulative Measure 2 =
IF (
NOT ISEMPTY ( FactTable ),
[Cumulative Measure]
)
Hi @tamerj1
This succeeds in removing the line on the graph on irrelevant months, but still totals the previous irrelevant months figures in the first relevant month
Hi @sparker22
In this case you need to edit the original measure code. Can you paste the code in a reply?
This is the original code. The relative date filter is added on the visual level, rather than code.
Thanks, this worked!!
Please try
Cumulative Total =
VAR CurrentDate =
MAX ( 'Calendar'[Date] )
VAR FirstDateWithData =
CALCULATE ( MIN ( 'Outcome'[Date] ), REMOVEFILTERS () )
RETURN
CALCULATE (
COUNT ( 'Outcome'[OutcomeID] ),
'Calendar'[Date] >= FirstDateWithData,
'Calendar'[Date] <= CurrentDate
)
Dhi @sparker22 ,
try to write a measure like:
CumCount =
VAR _date = MAX(TableName[Date])
RETURN
CALCULATE(
COUNT(TableName[ColumnOfInterest]),
TableName[Date] <= _date
)
Hi @FreemanZ
Appears to be counting backwards, and still including totals outside the relative date range
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 |