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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

TTM Measure Not Working

Hi All,

 

I have created a report that displays monthly recurring revenue (MRR) and other retention measures (New MRR, Churn MRR, etc). A requirement has been added to display a trailing twelve months (TTM) view. I created a MRR TTM measure that works fine, but my New MRR TTM measure does not. 

 

I have added information regarding my data model, screenshots of my measures, and resulting output below. Any help is much appreciated in advance!

 

Data Model:

  • Using Date table with Dates field, marked as Date table - 'Date'[Dates]
  • 'RevenueSchedules' is fact table - many-to-one relationship with 'Date' and 'Customers' table

 

Measures:

  • MRR = SUM(RevenueSchedules[Amount])
  • MRR TTM = CALCULATE([MRR], DATESINPERIOD('Date'[Dates], LASTDATE(DATEADD('Date'[Dates], -1, MONTH)), -12, MONTH))
  • New MRR = SUMX(Customers, IF([MRR] > 0 && [MRR TTM] = 0, [MRR]))
  • New MRR TTM = CALCULATE([New MRR], DATESINPERIOD('Date'[Dates], LASTDATE(DATEADD('Date'[Dates], -1, MONTH)), -12, MONTH)) 
 
Output:
FR_tmiller_0-1668107684610.png

 

 

 

 

2 REPLIES 2
v-rzhou-msft
Community Support
Community Support

Hi @Anonymous ,

 

I think you can try to calcualte the [New MRR] and [New MRR TTM] by VIRTUAL() table in your code. Due to I don't know your data model, here I will give you some suggestions. The measure should look like as below.

New MRR TTM =
VAR _VIRTUAL =
    SUMMARIZE (
        Date,
        'Date'[EOMDate],
        "New MRR",
            SUMX ( Customers, IF ( [MRR] > 0 && [MRR TTM] = 0, [MRR] ) )
    )
RETURN
    SUMX (
        DATESINPERIOD (
            'Date'[Dates],
            LASTDATE ( DATEADD ( 'Date'[Dates], -1, MONTH ) ),
            -12,
            MONTH
        ),
        [New MRR]
    )

If this measure still couldn't help you solve your issue, please share a sample file with me and show me a screenshot with the result you want.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

Hi Rico,

 

This did not work as I'm not seeing where you make use of the virtual table code. I've uploaded an example PBI file and expected output CSV file below. 

 

Expected Result 

Example 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.