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

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

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

Anonymous
Not applicable

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

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.

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.