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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Formula - Prior Week

I have a measure that tracks the amount of Returns  (by Return number...which is a text value).    This works fine for tracking current number of RMAs  (returns).  

 

However, I need to determine what the total count was, one week ago.   Tried several formulas but it keeps returning a "blank" value.    Any help is appreciated!

 

Cumulative RMA Count =
VAR CurrentDate= MAX( 'Date Table'[Date])
RETURN CALCULATE([Distinct Count of RMAs], ALL('Date Table'[Date]), 'Date Table'[Date]<=CurrentDate)
3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Try this measure

=calculate([Distinct Count of RMAs],datesbetween('Date Table'[Date],MAX( 'Date Table'[Date])-7,MAX( 'Date Table'[Date])-7))

In the date slicer (created from the Date Table, select any date.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@Ashish_Mathur     Unfortunately Ashish that still returned a blank value.   

 

I should clarify that I am looking for a cumulative total.   If you look at the small segment of a bar chart I have, you will see that we have just entered Week 40  (today).     Last week, the total return count was 869.   The week before (week 38) it was 844.  

 

So technically, the formula should return 869 (that was the cumulative total for week 39, the previous week), since we are now in week 40.   So when I say "last week" it is just not just a simple "today minus 7 days" as that would be a rolling week.   I need the cumulative total.    

 

texmexdragon_0-1601210158960.png

 

 

Hi,

I will need your PBI file to work with.  Also, in the Calendar Table, please ensure that you have a column for the week number.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.