Forum Discussion
YTD Project Count not working
- 8 years ago
Hi cnoakland
What I would suggest doing to ensure that the YTD or DatesYTD is working correctly is to ensure that you have a Date table in your Power BI Model.
The DAX Time Intelligence functions rely on there being a Date table in order to function correctly.
You can create the Date table here: https://www.fourmoo.com/2016/09/13/power-bi-how-to-easily-create-dynamic-date-tabledimension-with-fiscal-attributes-using-power-query/
Another option instead of using the DatesYTD is you could use the TOTALYTD which could also possibly give you the desired results?
I am trying to count the number of projects created YTD for each region. My data has a column for project ID, entered date, and region. My DAX is:
YTD Project Creation = CALCULATE(DISTINCTCOUNT(Detail[Project ID]),datesytd(Detail[Entered Date],"9/30/2014"))
But here is my visual (it's just an excel table here, but it's the table visual option in PowerBI). The count is correct- there were 8 projects created so far this year, but all the other data is wrong. What am I missing? Thanks.
| Region_1 | YTD Project Creation |
| SOUTH | 5 |
| CENTRAL | 4 |
| NA | 4 |
| CANADA | 2 |
| EAST | 1 |
| WEST | 1 |
| TOTAL | 8 |
Hi cnoakland
What I would suggest doing to ensure that the YTD or DatesYTD is working correctly is to ensure that you have a Date table in your Power BI Model.
The DAX Time Intelligence functions rely on there being a Date table in order to function correctly.
You can create the Date table here: https://www.fourmoo.com/2016/09/13/power-bi-how-to-easily-create-dynamic-date-tabledimension-with-fiscal-attributes-using-power-query/
Another option instead of using the DatesYTD is you could use the TOTALYTD which could also possibly give you the desired results?