cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pbreslin24
Regular Visitor

Calculating Between 2 dates over 2 months

Hello All! 

 

I am trying to calculate days in each month from a start date and End date that spans over 2 or 3 months. I can get the dates correct for each project just by calculating the difference between dates but i am not able to look at how many days are in each month graphically. Is there a way to add a colum or measure to show how many days are in each month or is there a way to graph how many days are in each month when it is 2 or 3 different months?

 

pbreslin24_0-1624508423652.png

 

Thank you All!

Pbreslin

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@pbreslin24 , I made a similar attempt in past, see if the attached pbix can help

 

or this blog

How to divide/distribute values between start date or end date or count days across months/days: https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-o...

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin

Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@pbreslin24 , I made a similar attempt in past, see if the attached pbix can help

 

or this blog

How to divide/distribute values between start date or end date or count days across months/days: https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-o...

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin

Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

View solution in original post

Edited: I believe i have it working now. My mistake was trying to use my own date selection to look at a table with the new measure. I needed to use the new table created and its working. Checked Manually for a few months and its good. Thank you for the help!!

 

Previous:

(Thank you for the reply. When i use this method it still adds the total value into whatever month the Data(startdate) is in. It did not divide the dates into each month. Below is my typed out measure. It is calculating the value correctly for total days between 2 dates. Am i missing part? 

 

Value by day of Month = CALCULATE(SUMX(SUMMARIZE(filter(CROSSJOIN('Work Order','Date'),'Date'[Date] >= 'Work Order'[Account Start Date] && 'Date'[Date]<= 'Work Order'[Account End Date]),'Work Order'[Name],'Date'[Date],'Work Order'[Account Rev Days],'Work Order'[Account Start Date],'Work Order'[Account End Date]),DIVIDE('Work Order'[Account Rev Days],DATEDIFF('Work Order'[Account Start Date],'Work Order'[Account End Date],DAY)+1)))

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.