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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SanjayZinjad
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

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.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @SanjayZinjad,

 

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.

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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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