cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lakshay1231 Frequent Visitor
Frequent Visitor

Need to calculate prior 3 months based on selected month

Hello all,

 

I am trying to calculate sum of a measure for last 3 months based on the selected month. I do not have a date table and I am importing the data from SSAS server. Its an import and not a live connection.

I only have a month and year fields for the time. I do not have a date.

 

Can someone please help?

 

Thanks,

Lakshay

3 REPLIES 3
VCQ Frequent Visitor
Frequent Visitor

Re: Need to calculate prior 3 months based on selected month

You should make a standard date table! It reelly helps.  Then you can calculate(measure, datesbetween) 

 

https://msdn.microsoft.com/en-us/query-bi/dax/datesbetween-function-dax

lakshay1231 Frequent Visitor
Frequent Visitor

Re: Need to calculate prior 3 months based on selected month

I do not want to get date in the query result set when I import the data. The result set is very huge and will take much longer if I get the date as well. Appreciate if you have another suggestion...

VCQ Frequent Visitor
Frequent Visitor

Re: Need to calculate prior 3 months based on selected month

In your import query combine the month and date and add first of month. Replace Jan with 1...etc and combine all the colu mns by adding a new column. Change the data format to date. Enjoy dax date functions.