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
webward3
New Member

Previous Month Measure

I have a date table joined to my fact table. I'm trying to create a previous month measure in my tabular model. When I use the following formula referencing my date table, I get the exact same measure as the current month:

Measure 1:=CALCULATE([OTD to CRD], DATEADD(DimDate[Date], -1, month))

 

When I use the date filed in my fact table, I get the previous month value, however I'm not able to use the measure with any dimension or slicer. I get error "DATEADD only works with contiguous date selections:

 

Measure 1:=CALCULATE([OTD to CRD], DATEADD(Global[RequestDate], -1, month))

 

Also, when I try to create a MTD measure using the Date table, it returns a (blank) value. Works well when I use date field in my fact table

Measure 2:=CALCULATE([OTD to CRD], DATESMTD(DimDate[Date]))

 

What am I missing?

6 REPLIES 6
Eric_Zhang
Microsoft Employee
Microsoft Employee


@webward3 wrote:

I have a date table joined to my fact table. I'm trying to create a previous month measure in my tabular model. When I use the following formula referencing my date table, I get the exact same measure as the current month:

Measure 1:=CALCULATE([OTD to CRD], DATEADD(DimDate[Date], -1, month))

 

When I use the date filed in my fact table, I get the previous month value, however I'm not able to use the measure with any dimension or slicer. I get error "DATEADD only works with contiguous date selections:

 

Measure 1:=CALCULATE([OTD to CRD], DATEADD(Global[RequestDate], -1, month))

 

Also, when I try to create a MTD measure using the Date table, it returns a (blank) value. Works well when I use date field in my fact table

Measure 2:=CALCULATE([OTD to CRD], DATESMTD(DimDate[Date]))

 

What am I missing?


@webward3

Could you try 

Measure 1 = CALCULATE([OTD to CRD], PREVIOUSMONTH(dimdate[Date]))

@Eric_ZhangI have blank value for my measure when taking that approach.


@webward3 wrote:
@Eric_ZhangI have blank value for my measure when taking that approach.

Could you share any sample data? Even better you can share the pbix file. You can upload it to any network drive and share the link. Do mask sensitive data before uploading.

Sean
Community Champion
Community Champion

Using your Measure 2

Create this Measure

Previous Month Measure =
CALCULATE ( [Measure 2], DATEADD ( DATESMTD ( DimDate[Date] ), -1, MONTH ) )

or this should also work

Previous Month Measure =
CALCULATE ( [Measure 2], PARALLELPERIOD ( DimDate[Date], -1, MONTH ) )
Sean
Community Champion
Community Champion

What is the range of your Calendar Table?

Thanks Sean but still getting same results.

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.