Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Logins R6M =
VAR _noMonths = 6
VAR _lastSelectedDate = MAX('Date'[Date])
VAR _period =
DATESINPERIOD( 'Date'[Date], _lastSelectedDate, -_noMonths, MONTH)
VAR _result =
CALCULATE(
AVERAGEX(
VALUES('Date'[Fiscal Month Number]),
[Logins (sum)]
),
_period
)
VAR _lastDateWithLogin = MAX( 'Monthly User Activity by Project'[Date])
VAR _firstVisibleDate = MIN('Date'[Date])
RETURN
IF( _firstVisibleDate <= _lastDateWithLogin, _result)
Logins R6M (filter) =
VAR _noMonths = 6
VAR _lastSelectedDate = MAX('Date'[Date])
VAR _period =
CALCULATETABLE(
DATESINPERIOD(
'Date'[Date],
_lastSelectedDate,
-_noMonths,
MONTH
),
ALL('Date'[Date])
)
VAR _result =
CALCULATE(
AVERAGEX(
VALUES('Date'[Fiscal Month Number]),
[Logins (sum)]
),
_period
)
VAR _lastDateWithLogin = MAX( 'Monthly User Activity by Project'[Date])
VAR _firstVisibleDate = MIN('Date'[Date])
RETURN
IF( _firstVisibleDate <= _lastDateWithLogin, _result)
If my logic is correct, that is I do need to extend the period outside the scope of the Page Slicer, then why do both measures return the exact same values for the first dates shown. There should be at least some deviation between the two measures for the first 'period', eventually coming into alignment the further away you get from the 'start'.
Hi @rpiboy_1,
Yes, DATESINPERIOD respects the slicer context, so it won't include dates outside the slicer range, which might cause inaccuracies. Your version with CALCULATETABLE and ALL('Date'[Date]) is better because it ensures all needed dates are considered for accurate rolling averages.
Did I answer your question? If so, please mark my post as the solution!✔️
Your Kudos are much appreciated! Proud to be a Responsive Resident!
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 |
---|---|
16 | |
13 | |
12 | |
11 | |
11 |
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
9 |