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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
JPO_10
Frequent Visitor

Measure's value at the end of previous year

Hi all,

 

With the help from @amitchandak  and @v-cgao-msft  I managed to get previous year's closing values from column. Thank you, guys.

 

Now the problem is to get last year's closing value from measure. Measure itself work perfectly. Also SAMEPERIODLASTYEAR looks good. ROCE is calculated as follows:

ROCE =
VAR Profit = [Income, ROCE]
VAR _Month = DATES[Month, measure]
VAR _Inv = ([Investment opening] + [Investment]) / 2
Return
((Profit / _Month) *12) / _Inv
 
For ROCE_LY_EOY I have tried 
ROCE_LY_EOY = CALCULATE(
                ROCE[ROCE],
                DATEADD(ENDOFYEAR(DATES[Date]),-1,YEAR)
)
 
Instead of zeros in ROCE_LY_EOY, it should be 62,5% for this year.
 
JPO_10_0-1664981845193.png

 

Hope you can help.

 

Cheers,

J

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

you could try

ROCE_LY_EOY =
VAR CurrentYear =
    YEAR ( MAX ( 'Dates'[Date] ) )
VAR LastYear = CurrentYear - 1
RETURN
    CALCULATE (
        ROCE[ROCE],
        REMOVEFILTERS ( 'Dates' ),
        TREATAS ( { ( LastYear, "December" ) }, 'Dates'[Year], 'Dates'[Month name] )
    )

View solution in original post

3 REPLIES 3
johnt75
Super User
Super User

you could try

ROCE_LY_EOY =
VAR CurrentYear =
    YEAR ( MAX ( 'Dates'[Date] ) )
VAR LastYear = CurrentYear - 1
RETURN
    CALCULATE (
        ROCE[ROCE],
        REMOVEFILTERS ( 'Dates' ),
        TREATAS ( { ( LastYear, "December" ) }, 'Dates'[Year], 'Dates'[Month name] )
    )

Thank you @johnt75 for helping out!

Hi @johnt75 ,

 

your solution solved my problem!

 

Many Thanks,

 

J

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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