cancel
Showing results for
Did you mean:
Frequent Visitor

## PY YTD Measures

Hi All,

I have created below formula formula for calculation of Current Yeat Closed Account count and  PY same count for Closed Account .

YTD–Closed Account = CALCULATE(COUNT(Accountt[AccountNumber]),DATESYTD(Accountt[OpenDate]),FILTER(Accountt,Accountt[Open Or Close?]="Close"))

PY YTD-Closed Account = CALCULATE(COUNT(Accountt[AccountNumber]),FILTER(Accountt,Accountt[Open Or Close?]="Close"),SAMEPERIODLASTYEAR(Accountt[OpenDate].[Date]))

OR

PY YTD-Closed Account1 = CALCULATE(COUNT(Accountt[AccountNumber]),FILTER(Accountt,Accountt[Open Or Close?]="Close"),PARALLELPERIOD(Accountt[OpenDate].[Date],-1,Year))

PY YTD-Closed Account and PY YTD-Closed Account1 getting the same out put. Even I have try for PREVIOUSYEAR() function but it show null value for Year filter.

I have added new column Open Year as per below calculation and set as Year filter at report page level.

Open Year = YEAR(Accountt[OpenDate])

But on basis of Year filter I will get same out put for [YTD–Closed Account] and [PY YTD-Closed Account] measures.

So required the correct calculation which will show me the correct count of [PY YTD-Closed Account] on the basis of Year and Month filter.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Visitor

## Re: PY YTD Measures

Hi Xiaoxin Sheng,

Thanks for your update.

I have added the DataDimension and set relation between respective tables. I have changed the measures calculation for date dim and got the expected output.

Regards,

Sanjay.

2 REPLIES 2
Highlighted
Community Support

## Re: PY YTD Measures

It will be help if you share some sample data and screenshots about your formula.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Highlighted
Frequent Visitor

## Re: PY YTD Measures

Hi Xiaoxin Sheng,

Thanks for your update.

I have added the DataDimension and set relation between respective tables. I have changed the measures calculation for date dim and got the expected output.

Regards,

Sanjay.

Announcements

#### August Community Highlights

Check out a full recap of the month!

#### August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

#### Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors