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
Fphizal
Regular Visitor

POWER BI

Fphizal_0-1723086367079.png

I want to calculate days between "DesignStartdate" and "datesentforreview"

I have created a relationship and still unable to derive the number of days required between dates.

1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Thanks for your insight, bhanu_gautam.

 

@Fphizal , if you want to calculate days between "DesignStartdate" and "datesentforreview", you need to make sure there's a valid relationship.

vstephenmsft_2-1723539217062.png

vstephenmsft_3-1723539223865.png

vstephenmsft_1-1723539158999.png

In this case, the relationship is one-to-one, and the number of days can be successfully calculated. Create a measure to return days.

Measure = DATEDIFF(MAX('Artwork Tracker'[DesignStartdate]),MAX('Review List'[datesentforreview]),DAY)

vstephenmsft_0-1723539138837.png

 

 If the relationship is a one-to-many pair, the number of days can also be successfully calculated.

vstephenmsft_2-1723539217062.png

vstephenmsft_4-1723539292438.png

vstephenmsft_6-1723539372454.png

vstephenmsft_7-1723539388430.png

 

If the above requirements do not meet you, please provide more details. It's a good idea to provide some simple sample data and the desired results, as I did.

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Thanks for your insight, bhanu_gautam.

 

@Fphizal , if you want to calculate days between "DesignStartdate" and "datesentforreview", you need to make sure there's a valid relationship.

vstephenmsft_2-1723539217062.png

vstephenmsft_3-1723539223865.png

vstephenmsft_1-1723539158999.png

In this case, the relationship is one-to-one, and the number of days can be successfully calculated. Create a measure to return days.

Measure = DATEDIFF(MAX('Artwork Tracker'[DesignStartdate]),MAX('Review List'[datesentforreview]),DAY)

vstephenmsft_0-1723539138837.png

 

 If the relationship is a one-to-many pair, the number of days can also be successfully calculated.

vstephenmsft_2-1723539217062.png

vstephenmsft_4-1723539292438.png

vstephenmsft_6-1723539372454.png

vstephenmsft_7-1723539388430.png

 

If the above requirements do not meet you, please provide more details. It's a good idea to provide some simple sample data and the desired results, as I did.

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

bhanu_gautam
Super User
Super User

@Fphizal , 

Create a new calculated column by going to modelling tab and click on new column

 

DaysBetween =
DATEDIFF(
    'ArtworkTracker'[Designstartdate],
    RELATED('Review List'[datesentforreview]),
    DAY
)



Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






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 Solution Authors