Quantcast
Viewing all articles
Browse latest Browse all 217117

YTD last year DAX

Hi,

 

I have question about YTD Last year DAX formula. Even though I have read many blogs and topics here in community, I still don't know how to solve this issue.

Suppose I have data like below.

 

IDDateAmount
101.01.201610
202.01.201615
303.01.201611
410.01.20168
520.02.20167
601.01.201710
702.01.201712
803.01.20179

 

I would like to figure up YTD value of amount for actual data (year 2017) and then YTD value for corresponding period previous year.

 

For YTD I use formula:

 

YTD = CALCULATE(SUM(Data[Amount]);DATESYTD(Date[Date]))

 

For YTD LY I use formula:

 

YTD LY = CALCULATE([YTD];SAMEPERIODLASTYEAR(Date[Date]))

 

Then when I use these formulas in PBI, I have got incorrect value for YTD LY. I expect value 36 (dates: 1.1. - 3.1. 2016), but in total I have got 44 (it also calculates Amount 8 in 10.1.2016) - so it gives me period of january 2016, but I want only the corresponding days from 2017.

But YTD LY value in pic below on row for 3.1.2017 is OK.

 

Image may be NSFW.
Clik here to view.
YTD_LY.PNG

 

Does anybody know the solution?

 

Thanks.

Regards.

Pavel


Viewing all articles
Browse latest Browse all 217117

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>