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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Summing last month revenue

Hello guys, I've got a measure that sums the revenue of the current month, but I can't sum the last month's revenue, I tried this. LastMonth = CALCULATE([SUMREVENUE];LASTDATE('Calendar'[Date]) -1) but it doesn't work, how can i sum the last month's revenue based on this measure ?
1 ACCEPTED SOLUTION
Anonymous
Not applicable

I did that, thanks guys! As a got some blank registers I managed to use nonblank function so I worked like LastMONTH = CALCULATE([SUMREVENUE];PREVIOUSMONTH(LASTNONBLANK('Calendar'[Date];[SUMREVENUE]))) It worked xD

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

I did that, thanks guys! As a got some blank registers I managed to use nonblank function so I worked like LastMONTH = CALCULATE([SUMREVENUE];PREVIOUSMONTH(LASTNONBLANK('Calendar'[Date];[SUMREVENUE]))) It worked xD

@Anonymous,

 

By the way, you may help accept solution. Your contribution is highly appreciated.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

I can't select solution I don't know why but it return this error: Authentication failed for the action you are trying to do. This failure could be due to your browser not supporting JavaScript, JavaScript not being enabled, or trying to use the action URL directly in the browser address bar instead of clicking the link on the page.
themistoklis
Community Champion
Community Champion

@Anonymous

 

You can try the following formula:

Measure = CALCULATE([SUMREVENUE], PREVIOUSMONTH(Calendar[Date]))
Anonymous
Not applicable

I tried this but it returned blank, I forgot to mention that the my date table goes until january of 2019 which has no revenue value, the last value registered is on 11 december
AlB
Super User
Super User

Hi @Anonymous

 

What is the code for [SUMREVENUE]? Where/how do you intend to use [LastMonth]?

Anonymous
Not applicable

SUMREVENUE = SUM(Revenue[Revenue Value]) I intend to use it doing like CURRENTMONTH - LASTMONTH so I can see the variation, you know?

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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