Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
25 | |
12 | |
9 | |
9 | |
9 |
User | Count |
---|---|
19 | |
14 | |
14 | |
13 | |
13 |