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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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))

 

 

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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