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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
chavanr
Resolver I
Resolver I

Calculate Previous month giving blank values

Hi there,

 

I am trying to calculate a column for previous month value & it is returning blank value

 

Recycling Tonnes LM = CALCULATE(SUM('Collection Transactions New'[Recycling Tonnes New]),DATEADD('Calendar'[DWHDimDateKey],-1,MONTH))
 
chavanr_0-1620217453358.png

Many thanks

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi @chavanr  , 

 

You could create a column by the following formula:

Recycling Tonnes LM =
VAR _a =
    EOMONTH ( 'Collection Transactions New'[DWHDimDateKey], -1 )
RETURN
    CALCULATE (
        SUM ( [Recycling Tonnes New] ),
        FILTER ( 'Collection Transactions New', EOMONTH ( [DWHDimDateKey], 0 ) = _a ))

The final output is shown below:

v-yalanwu-msft_0-1620381481518.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yalanwu-msft
Community Support
Community Support

Hi @chavanr  , 

 

You could create a column by the following formula:

Recycling Tonnes LM =
VAR _a =
    EOMONTH ( 'Collection Transactions New'[DWHDimDateKey], -1 )
RETURN
    CALCULATE (
        SUM ( [Recycling Tonnes New] ),
        FILTER ( 'Collection Transactions New', EOMONTH ( [DWHDimDateKey], 0 ) = _a ))

The final output is shown below:

v-yalanwu-msft_0-1620381481518.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

themistoklis
Community Champion
Community Champion

Hello @chavanr ,

 

The formula in the image is different from the one on the text message.

 

First make sure the field  'Calendar'[DWHDimDateKey]  is on date format

 

Try the following:

Recycling Tonnes LM  =
CALCULATE (
SUM('Collection Transactions New'[Recycling Tonnes New]),
PREVIOUSMONTH ( 'Calendar'[DWHDimDateKey] )
)

 

Remove .month at the end of the formula

It is still giving blank values,DWHDimDateKey is marked as date table. 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

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.

Top Solution Authors