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
Gumberculeez
Helper II
Helper II

Getting last 90 days of data

Hey all;

 

I'm trying to create a real time DSI and having difficulty on the last 90 days measure.  

 

Here is my measure below, and it "passes" however I get the following error.

 

Rev90 = CALCULATE([Revenue], DATESINPERIOD(GLTransDetails[Date], TODAY(), -90, DAY))
 
Gumberculeez_0-1709654311558.png

is there another "dates" DAX variable I should be using to get my last 90 days of sales?

 

1 ACCEPTED SOLUTION
Gumberculeez
Helper II
Helper II

Thanks to GPT :)... got it to work.  For FYI:

 
Rev90 = CALCULATE(
    [Revenue],
    FILTER(
        'GLTransDetails',
        'GLTransDetails'[Date] >= TODAY() - 90 && 'GLTransDetails'[Date] <= TODAY()
    )

 

this pulls passes, and does not error.

View solution in original post

3 REPLIES 3
Gumberculeez
Helper II
Helper II

Thanks to GPT :)... got it to work.  For FYI:

 
Rev90 = CALCULATE(
    [Revenue],
    FILTER(
        'GLTransDetails',
        'GLTransDetails'[Date] >= TODAY() - 90 && 'GLTransDetails'[Date] <= TODAY()
    )

 

this pulls passes, and does not error.

amitchandak
Super User
Super User

@Gumberculeez , if you need based on today

 

Last 90 =
var _max = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
var _min = _max -90
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))

 

or

 

 

Last 90 =
var _max =  today()
var _min = _max -90
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))

 

or

 

Last 90 =
var _max =  today()
var _min = _max -90
return
CALCULATE([net] ,filter('Date','Date'[Date]>= _min && 'Date'[Date] <= _max))

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Both of those generate the same error.

Gumberculeez_0-1709657406256.png

 

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.