This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi Guys,
I have multiple measures and the business have asked me to show the same measures as a rolling 3 month number.
Here is one measure I have:
Order Count =
DISTINCTCOUNT(orders[order_number])Here is the R3M equivalent (based on fiscal calendar):
Order Count R3M =
VAR __lastVisibleDate =
LASTDATE ( 'Time'[Date] )
VAR __financialPeriod =
MIN ( 'Time'[YearMonthKey] ) - 2
VAR __fromDate =
CALCULATE (
FIRSTDATE ( 'Time'[Date] ),
FILTER ( ALL ( 'Time' ), 'Time'[YearMonthKey] = __financialPeriod )
)
VAR __canMove3MBack =
NOT ISBLANK ( DATEADD ( __lastVisibleDate, -2, MONTH ) )
VAR __result =
CALCULATE (
[Order Count],
DATESBETWEEN('Time'[Date], __fromDate, __lastVisibleDate)
)
RETURN
IF ( __canMove3MBack, __result )I would like to add the DAX from the R3M into a calculation group and reuse it but because my calculation is in a variable (__result) I don't know how. Is this possible?
Solved! Go to Solution.
In the calculation item (within the calculation group), replace [Order Count] with SELECTEDMEASURE(). This will make it dynamic for whatever measure is in the visual.
Proud to be a Super User!
In the calculation item (within the calculation group), replace [Order Count] with SELECTEDMEASURE(). This will make it dynamic for whatever measure is in the visual.
Proud to be a Super User!
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 36 | |
| 29 | |
| 29 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 70 | |
| 40 | |
| 33 | |
| 24 | |
| 23 |