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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.