Forum Discussion
Need help to calculate days
Days between "Designstartdate" and "datesentforreview"
How do i achieve this?
7 Replies
- bhanu_gautam
Super User
Anonymous , What is the relation between both tables
- AnonymousNot applicable
Many to many? Beginner at power bi, any advice how can i calculate the days between two diff data set.
- bhanu_gautam
Super User
Anonymous , Create a new calculated column by going to modelling tab and click on new column
DaysBetween =DATEDIFF('ArtworkTracker'[Designstartdate],RELATED('Review List'[datesentforreview]),DAY)
- bhanu_gautam
Super User
Anonymous , Try creating a new measure using
DaysBetweenMeasure =VAR DesignStartDate = CALCULATE(MIN('ArtworkTracker'[Designstartdate]), 'ArtworkTracker'[Reqid] IN VALUES('Review List'[Reqid]))VAR DateSentForReview = CALCULATE(MIN('Review List'[datesentforreview]), 'Review List'[Reqid] IN VALUES('ArtworkTracker'[Reqid]))RETURN DATEDIFF(DesignStartDate, DateSentForReview, DAY) - AnonymousNot applicable
Hi Anonymous ,
Do you want to add a custom column to one table to calculate days between two date columns in two different tables?
Assuming that the REQID and RequestID columns have a one-to-one relationship, you can first establish a table relationship and then use DATEDIFF and RELATED to create the custom column.
Here is my test for your reference.
My tables.
The relationship.The DAX.
CountDays = DATEDIFF(TableDate1[Designstartdate],RELATED(TableDate2[Datesentforreview]),DAY)The result of my test.
Best regards,
Mengmeng Li