Forum Discussion
Need help on YTD Measure
Hi There,
Can someone help on YTD measure calculation.
I need YTD of Temp_Headcount .
I have also attached pbix file for reference.
https://drive.google.com/open?id=1HhgZpMouU9iyCJzEGJf5EbDARQXWId7Y
Hi Anonymous ,
You need to correct your measure of YTD as below:
Temp_Headcount_YTD = CALCULATE(SUMX(VALUES('Date Table'[MonthYear]),[Temp_Headcount]),DATESYTD('Date Table'[Date]))Then you will see as below:
For the related .pbix file ,you can turn to the URL below:
Hope this would help.
Best Regards,
Kelly
3 Replies
- amitchandak
Super User
Headcount , itself is a cumulative measure. There is can not be YTD for that.
How many employees I have at the end of Month is the same for YTD ,QTD, MTD.
Employees at end of Feb-2019 is the employee for month Feb-2019, Year till Feb 2019.
If not, what is expected value ?
You can have hire YTD.
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.
My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p/881739
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601 - v-kelly-msft
Community Support
Hi Anonymous ,
You need to correct your measure of YTD as below:
Temp_Headcount_YTD = CALCULATE(SUMX(VALUES('Date Table'[MonthYear]),[Temp_Headcount]),DATESYTD('Date Table'[Date]))Then you will see as below:
For the related .pbix file ,you can turn to the URL below:
Hope this would help.
Best Regards,
Kelly
- VasTg
Memorable Member
Anonymous
Unfortunately, i do not have access to Onedrive right now..
Do you have a calander table? If so,use the below DAX function.
TOTALYTD(table[temp_ytd],calander[dates])
Create a dates table as below.
Dates =VAR DateRange = CALENDARAUTO()RETURNADDCOLUMNS(DateRange,"Year",YEAR([Date]),"Month",FORMAT([Date],"mmmm"),"Year Month", FORMAT([Date],"yyyy-mmmm"),"YearMonthSort",YEAR([Date])*100 + MONTH([Date]),"ShortName",FORMAT([Date],"ddd"),"IsWeekDay", NOT WEEKDAY( [Date] ) IN {1,7},"MonthNum", MONTH( [Date] ))If this helps, mark it as a solution.
Kudos are nice too.