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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
LyncoData1
Helper I
Helper I

PYTD Feb Duplicates

I am calulating PYTD for year 2020. However, the month of Feb in 2020 has duplicated the same values from Feb 28th to Feb 29th (159.20). I am not sure if it is because the month of Feb 29 days compared to previous years where Feb is typically 28 days. When I only bring in Net Sales for 2019 the number does not duplicate. However, when I use PYTDSales measure the numbers duplicate themselves. Do you have any insight on how to fix?

  

My Net Sales Measure: 

NetSales = CALCULATE(SUM(FactNetSales[Amount]))
 
Measure to pull prior year sales:
PYTDSales =
CALCULATE(
[NetSales],
SAMEPERIODLASTYEAR(
'DimCalendar'[DateKey]
)
)
 
PBI.JPG
1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi @LyncoData1 ,

 

Modify your measure as below:

 

PYTDSales =IF(SELECTEDVALUE('DimCalendar'[DateKey])=DATE(2020,2,29),BLANK(),
CALCULATE(
[NetSales],
SAMEPERIODLASTYEAR(
'DimCalendar'[DateKey]
)
)

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

 

View solution in original post

2 REPLIES 2
v-kelly-msft
Community Support
Community Support

Hi @LyncoData1 ,

 

Modify your measure as below:

 

PYTDSales =IF(SELECTEDVALUE('DimCalendar'[DateKey])=DATE(2020,2,29),BLANK(),
CALCULATE(
[NetSales],
SAMEPERIODLASTYEAR(
'DimCalendar'[DateKey]
)
)

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

 

This worked! Thank You!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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