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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

previous same period data issue

Capture.PNG

 

I have date table also with formula and relationship master table 

Dates = CALENDAR (DATE (2014, 1, 1), DATE (2018, 12, 31))
 
But i still can't solve this issue. 
1 REPLY 1
OwenAuger
Super User
Super User

@Anonymous

 

It appears you want to create a measure summing interest_income for the YTD period one year ago.

 

I would suggest rewriting your measure like this:

A =
CALCULATE (
    SUM ( 'RP_001_GIME final_net_income'[interest_income] ),
    DATESYTD ( SAMEPERIODLASTYEAR ( Dates[Date] ) )
)

Once defined, the value of a variable is fixed, so in your original measure, the Step1 variable stored the YTD value, and this value didn't change in the subsequent CALCULATE.

 

Really the only way to apply two date shifts in sequence is to nest them as I have here, and you should have the actual SUM expression as the first argument of CALCULATE.

 

However, I can't explain why your measure returned blanks for years earlier than 2018. Just confirming that the Year colum is from the Dates table? If that's still a problem, please post back or post a sample pbix if possible.

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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