Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
JimJim
Responsive Resident
Responsive Resident

Calculation Groups

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?

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@JimJim,

 

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.

 

DataInsights_0-1661175296897.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
DataInsights
Super User
Super User

@JimJim,

 

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.

 

DataInsights_0-1661175296897.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.