The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi there,
I am trying to calculate a column for previous month value & it is returning blank value
Many thanks
Solved! Go to Solution.
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:
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.
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:
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.
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.