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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
cnoakland
New Member

YTD Project Count not working

I want to count the number of projects created for the fiscal year to date. My data has a Project ID column and a date entered column.

 

Here is my DAX:  

YTD Project Creation = 
CALCULATE(DISTINCTCOUNT(Detail[Project ID]),DATESYTD(Detail[Entered Date],"9/30/2014"))

Now... the count is correct. There were 8 projects created in FY17 so far. But this is my visual (this is a just an excel table- but you can get the idea of the Table visual in Power BI)

 

Region_1YTD Project Creation
SOUTH5
CENTRAL4
NA4
CANADA2
EAST1
WEST1
TOTAL8

 

All the regional numbers are incorrect. Why are the regions not adding up to the total? 

1 ACCEPTED SOLUTION

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-fi...

 

Another option instead of using the DatesYTD is you could use the TOTALYTD which could also possibly give you the desired results?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

View solution in original post

5 REPLIES 5
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @cnoakland,

 

Could you please mark the proper answer as solution or share the solution if it's convenient for you? That will be a big help to the others.

 

Best Regards!
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @cnoakland,

 

Because of the context. The context of Total is the whole "Region_1". It seems you have one project in many regions. Maybe you data looks like this:

Entered Date	Region_1	Project ID
1/4/2017	Canada	         1
1/10/2017	Canada	         3
1/2/2017	Central	         1
1/8/2017	Central          3
1/5/2017	East	         1
1/11/2017	East	         4
1/3/2017	NA	         1
1/9/2017	NA	         4
1/1/2017	South	         1
1/7/2017	South	         2
1/6/2017	West	         1
1/12/2017	West	         5

Then you can try this formula:

 

V2 YTD Project Creation =
SUMX (
    SUMMARIZE ( 'Detail', Detail[Region_1], "YTD P C", [YTD Project Creation] ),
    [YTD P C]
)

YTD Project Count not working .jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
cnoakland
New Member

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_1YTD Project Creation
SOUTH5
CENTRAL4
NA4
CANADA2
EAST1
WEST1
TOTAL8

 

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-fi...

 

Another option instead of using the DatesYTD is you could use the TOTALYTD which could also possibly give you the desired results?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Thank you @GilbertQ. I am new to Power BI and didn't fully understand the DAX time intelligence. I created a Date table and got everything working correctly. Cheers!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.