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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
RichOB
Post Patron
Post Patron

Day count if an end date is input

Hi, using the table below, I want to split up 2023 and 2024 and have a Count based on how many end dates there are. I'm looking for:

2023 = 3
2024 = 5 

 

Start_DateEnd_Date
01/06/202301/07/2023
01/07/202325/07/2023
01/08/2023 
01/09/202312/09/2023
01/06/202401/07/2024
01/07/202401/08/2024
01/08/2024 
01/09/202422/09/2024
01/10/202411/10/2024
01/11/202421/11/2024


Thanks

1 ACCEPTED SOLUTION
BhavinVyas3003
Memorable Member
Memorable Member

Hi @RichOB ,

 

Please try creating calculated column,

End_Year = IF(NOT ISBLANK([End_Date]), YEAR([End_Date]))


Thanks,
Bhavin
Problem solved? Hit “Accept as Solution” and high-five me with a Kudos! Others will thank you later!

View solution in original post

3 REPLIES 3
ajaybabuinturi
Solution Supplier
Solution Supplier

Hi @RichOB,
I'm not sure about out put results you are looking. However I am assuming you want to to count end dates based on year. you can follow the below steps.

1.Make sure year column is avaialble in the dataset (Create a calculated column based on enddate). I believe provided End_Date is not in proper Date format. Make sure all dates are in Date format.

EndDtYr = YEAR('Table'[End_Date])

ajaybabuinturi_0-1748869979398.png

2.Create a measure for count of end dates 

CountEnd_Date = COUNT('Table'[End_Date])

ajaybabuinturi_0-1748869879377.png

 3.Make sure when you are using EndDtYr column should be don't summarize.

ajaybabuinturi_1-1748870014542.png

 

Thanks,
If you found this solution helpful, please consider giving it a Like👍 and marking it as Accepted Solution✔. This helps improve visibility for others who may be encountering/facing same questions/issues.

BhavinVyas3003
Memorable Member
Memorable Member

Hi @RichOB ,

 

Please try creating calculated column,

End_Year = IF(NOT ISBLANK([End_Date]), YEAR([End_Date]))


Thanks,
Bhavin
Problem solved? Hit “Accept as Solution” and high-five me with a Kudos! Others will thank you later!
freginier
Solution Sage
Solution Sage

Hello, can you be more specific about what "input" means ? Do you mean by input "not null" ? 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.