Forum Discussion
YTD and LYTD calculation Issue
Hello,
I am trying to create some KPI's and I am using the following calculations for CYTD Sales and LYTD Sales:
CYTD Sales: CALCULATE(SUM('Sales Base'[Amount]),DATESYTD(('Calendar'[Date]),"3/31"))
LYTD Sales: CALCULATE(SUM('Sales Base'[Amount]),DATESYTD(dateadd('Calendar'[Date],-1,Year),"3/31"))
I have added a date calender and have a relationship between my sales table and calender table. I am having an issue as the amounts are showing full year amounts, instead of YTD. Then when I try to use the Sales table dates inplace for calender dates it shows up as blank.
Hi ROCKYDO12 ,
Your measures should work. There are other peculiarities in your model that could be causing this. Please see this PBIX for you reference - https://drive.google.com/file/d/108pq_k-N8CPQt5hTsaZgU8rP9h4L2dKs/view?usp=sharing
Hi ROCKYDO12 ,
Your measures work fine after creating the relationship which was not in the file you attached.
https://drive.google.com/file/d/1kcxiM9q401vRiMzYKE6QMhMeUQBPa58x/view?usp=sharing