i have a start date and an end date, and i am trying to count how many days in each month, have each period, i use DATEDIFF, but this just give me the days for 1 monthin example, the start date is 04/maythe end date is 04/julyand i want to know how many days have the period in may and in july.hope someone can help me.
@MarcoLopez you have to give internal as "DAY", here is more information about datediff
Proud to be a Datanaut! Appreciate your Kudos Feel free to email me with any of your BI needs.
thanks for your reply, but if i just put day, the result is the days in the time period but i need (in the example) the number of days in may and in july, not the total
@MarcoLopez oh in this case you want to know total number of day in may and in june so which will be 31 days for may and 30 days for june, total 61, is this what you are after?
yes, thats what im looking for.thank you
@MarcoLopez you can add a column something like this
Total Days =
DAY( EOMONTH( Table2[Start], 0 ) ) + DAY( EOMONTH( Table2[End], 0 ) )
@parry2k thank you, that works for the total days, but didnt give me the days for each month, I am trying creating columns for each month but i dont get to the correct result
@MarcoLopez add two seperae column.
Days for Start Month =
DAY( EOMONTH( Table2[Start], 0 ) )
Days for End Month =
DAY( EOMONTH( Table2[End], 0 ) )
@parry2k it didnt work, the expression didnt allow me to select the date column
@MarcoLopez not sure why, can you share sample data?
Engage and empower students with Power BI!
Continue your learning in our online communities.
Travel to Melbourne and network with thousands of peers!