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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
powerinbi
Frequent Visitor

PREVIOUSMONTH with null current month

Hi everyone!

 

I am in a situation where I have a table with 3 columns: Asset name, Month, Depreciation.
I am using PREVIOUSMONTH to find the depreciation for an asset 1 month ago.

However, if an asset is not having any depreciation in current month, then there simply is not a row for current month. In that situation, the PREVIOUSMONTH returns 0 and not the actual previous month value.

For example, how do I use the previous month formula here, so that it returns 150 (not 0) for asset 10001 and 200 for 20002?

 Asset    Month Depreciation
1000103-2021150
2000204-2021100
2000203-2021200

 

Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@powerinbi 

 

Before you start doing any time-intel calculations, I'd strongly and kindly advise you familiarize yourself with how such things work. You can start with this: Time Intelligence in Power BI Desktop - SQLBI

 

Quick Hint: You are not using the time-intel function with a real date table so the result will be wrong, even if SOMETIMES it will be correct.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

@powerinbi 

 

Before you start doing any time-intel calculations, I'd strongly and kindly advise you familiarize yourself with how such things work. You can start with this: Time Intelligence in Power BI Desktop - SQLBI

 

Quick Hint: You are not using the time-intel function with a real date table so the result will be wrong, even if SOMETIMES it will be correct.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors