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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
marcosvcortes00
Frequent Visitor

Duration per month between dates and for a specific year.

Duration per month between dates and for a specific year.

Hello, I am in the following situation:

 

Project Start             End          Duration
A         01/12/2022  30/01/2023  60
B         01/12/2023  30/01/2024  60
C         01/10/2023  30/11/2023  60
D        01/12/2022  30/01/2024  425

I need to report the duration per month of each project in a table, but only of the months in the year 2023.

Example: Project A: will work 30 days in January 2023, while project C will work 60 days.

Notice that there are projects that start or end in 2023, but there are projects that start and end in other years, however, have work in 2023, as is the case of project D.

(Forgive for my English).

2 ACCEPTED SOLUTIONS
Stachu
Community Champion
Community Champion

you cound do something like this (as calculated column):

Duration in 2023 = COUNTROWS(FILTER(GENERATESERIES([Start],[End],1),YEAR([Value]) = 2023))

Is this approach fine, or do you need a measure?

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

A seemingly easy question, it's in fact beyond quite many seasoned PBI users.

CNENFRNL_0-1665346350200.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

7 REPLIES 7
CNENFRNL
Community Champion
Community Champion

CNENFRNL_0-1665259302194.gif


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Thank you for your answer.
As soon as I have the company computer, I will be applying your suggestion.
But with this I can distribute the duration values per month?

 

Example:

 

Project A
January
30 days

 

Project C
October November
31 days  30 days

A seemingly easy question, it's in fact beyond quite many seasoned PBI users.

CNENFRNL_0-1665346350200.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Very very good! Worked perfectly! It's good to be able to count on people like you. Thank you for being able to share some of your knowledge here in the community.


(Translated text)

Stachu
Community Champion
Community Champion

you cound do something like this (as calculated column):

Duration in 2023 = COUNTROWS(FILTER(GENERATESERIES([Start],[End],1),YEAR([Value]) = 2023))

Is this approach fine, or do you need a measure?

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Worked perfectly! Thank you for your help.


(Translated text)

Thank you for your answer.
As soon as I have the company computer, I will be applying your suggestion.
But with this I can distribute the duration values per month?

 

Example:

 

Project A
January
30 days

 

Project C
October November
31 days  30 days

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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

Top Kudoed Authors