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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors