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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
Lodan
Helper II
Helper II

Recurring Revenue Measurement

Hello,

 

I am a bit stuck.  The worst thing is I have done this before and it worked so not sure what I am doing wrong now.

 

Effectively for each month I wanted to sum up the revenue for that month.

However this includes recurring revenue.  So I want to include this as long as the date is between the 'completed' date and the 'end of term' date.  It doesn't seem to want to do that at the moment.

 

Any help would be appreciated please.

 

SD Help.pbix

 

Thanks and regards

2 ACCEPTED SOLUTIONS
Greg_Deckler
Community Champion
Community Champion

@Lodan Try the following. I believe you used MaxDate twice whereas the second time it should have been MinDate. You also waaaaaay overused CALCULATE. 

MRR Revenue NC = 
VAR MaxDate = MAX( 'Date2'[Date] )
VAR MinDate = MIN( 'Date2'[Date] )
VAR __Table = FILTER( ALL( 'CMD Items' ), [Completed Date] <= MaxDate && [End of Term] > MinDate )
VAR Result = SUMX( __Table, [MRR$] )
RETURN Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

johnt75
Super User
Super User

I think you need to add REMOVEFILTERS( 'Date2' )

MRR Revenue2 = 
VAR MaxDate = CALCULATE( MAX( 'Date2'[Date] ) )
VAR MinDate = CALCULATE( MIN( 'Date2'[Date] ) )
VAR Result = CALCULATE(
	SUM( 'CMD Items'[MRR$] ),
    'CMD Items'[Completed Date] <= MaxDate,
    'CMD Items'[End of Term]> MaxDate,
    REMOVEFILTERS( 'Date2' )
)
RETURN Result

View solution in original post

7 REPLIES 7
johnt75
Super User
Super User

I think you need to add REMOVEFILTERS( 'Date2' )

MRR Revenue2 = 
VAR MaxDate = CALCULATE( MAX( 'Date2'[Date] ) )
VAR MinDate = CALCULATE( MIN( 'Date2'[Date] ) )
VAR Result = CALCULATE(
	SUM( 'CMD Items'[MRR$] ),
    'CMD Items'[Completed Date] <= MaxDate,
    'CMD Items'[End of Term]> MaxDate,
    REMOVEFILTERS( 'Date2' )
)
RETURN Result

That worked, thanks!

Greg_Deckler
Community Champion
Community Champion

@Lodan Try the following. I believe you used MaxDate twice whereas the second time it should have been MinDate. You also waaaaaay overused CALCULATE. 

MRR Revenue NC = 
VAR MaxDate = MAX( 'Date2'[Date] )
VAR MinDate = MIN( 'Date2'[Date] )
VAR __Table = FILTER( ALL( 'CMD Items' ), [Completed Date] <= MaxDate && [End of Term] > MinDate )
VAR Result = SUMX( __Table, [MRR$] )
RETURN Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler Actually didn't quite fix it.  It worked as it was but when I then try to add a visual filter nothing happened.  I beleive the 'all' was stopping that but if i remove the 'all' it goes back to only counting the MRR against 1 month again.

 

Any ideas please?

@Lodan You can use ALLSELECTED instead of ALL to preserve the filters.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Ignore please, I saw and tried JohnT's suggestion and that worked.  Thanks!

That did it!  Thanks very much

Helpful resources

Announcements
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.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.