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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Matrix visual for YTD vs. Previous Year

Experts,

I am having a scenario, Assume have only one measure and that should show current year YTD i.e June 2023 and Previous Year YTD till June 2022 only. How would I made my measure should show for the Current Year YTD vs. Previous Year YTD in the same measure dynamically? Below is the ssnapshot that my measure is displays the Current Year 2023 YTD is looks good, but for 2022 it is summing till Dec 2022. please help?bmunagapati_1-1690287634951.png

 

 

2 REPLIES 2
Anonymous
Not applicable

Hi  @Anonymous ,

Maybe the function SAMEPERIODLASTYEAR could help you.

It returns a table that contains a column of dates shifted one year back in time from the dates in the specified dates column, in the current context.

Besides, you can use something like this:

Measure =
VAR _a =
    MAXX ( ALL ( 'Table'[Date] ), [Date] ) //get the max date 
VAR _b =
    EOMONTH ( _a, -12 ) //end of the same month in last year 
RETURN
    CALCULATE (
        SUM ( [Value] ),
        FILTER ( ALL ( 'Table' ), [Date] <= _b && YEAR ( [Date] ) = YEAR ( _a ) - 1 )
    )

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @amitchandak please help on this, you helped me in multiple work arounds. Thanks 🙂

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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