cancel
Showing results for
Did you mean:
Frequent Visitor

## Prior Year YTD won't calculate

Hi guys,

Quick question on Prior Year YTD. I've been following the solved solutions on the prior threads but can't get my results to work.

I've created a separate contiguous date table (New Dates) to link to my General Ledger table "Date" column (The GL transactions table has multiple transactions for various dates) as one to many relationship.

I've then written my YTD and prior YTD measures as such:

`Net Amount = sum(GeneralLedger[Net Amount])YTD Total = TOTALYTD([Net Amount],GeneralLedger[Date])YTD Prior = CALCULATE([Net Amount], SAMEPERIODLASTYEAR('New Dates'[Date]))`

This the the resulting table:

Any ideas why this isn't working?

Much appreciated for the help!

1 ACCEPTED SOLUTION

Accepted Solutions
Frequent Visitor

## Re: Prior Year YTD won't calculate

Hi @plddogs

You can use below DAX for your Prior Year calculation:

Prior YTD: TOTALYTD([Net Amount], DATEADD(GeneralLedger[Date], -1, YEAR))

I think it'll works for you.

5 REPLIES 5
Highlighted
Super Contributor

## Re: Prior Year YTD won't calculate

HI @plddogs

`YTD Prior = CALCULATE('GeneralLedger'[YTD Total], SAMEPERIODLASTYEAR('New Dates'[Date]))`

Proud to be a Datanaut!

Frequent Visitor

## Re: Prior Year YTD won't calculate

Sorry, I m not sure I get that formula. Maybe you can help explain.

Is there suppose to be an expression after calculate? And also, GenearlLedger [YTD Total] is not set as a dimension at this point.

Super Contributor

## Re: Prior Year YTD won't calculate

Hi @plddogs

It should just be referencing your calculated measure

`YTD Prior = CALCULATE([YTD Total], SAMEPERIODLASTYEAR('New Dates'[Date]))`

Proud to be a Datanaut!

Frequent Visitor

## Re: Prior Year YTD won't calculate

Hi @plddogs

You can use below DAX for your Prior Year calculation:

Prior YTD: TOTALYTD([Net Amount], DATEADD(GeneralLedger[Date], -1, YEAR))

I think it'll works for you.

Frequent Visitor

## Re: Prior Year YTD won't calculate

Figured it out. Thanks all!

Announcements

#### Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

#### Community News & Announcements

Get your latest community news and announcements.

#### Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

#### Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Top Kudoed Authors
Users Online
Currently online: 6 members 2,242 guests
Recent signins: