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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Fphizal
Regular Visitor

Need help to calculate days

Fphizal_0-1723086776069.png

Days between "Designstartdate" and "datesentforreview"
How do i achieve this?

7 REPLIES 7
Anonymous
Not applicable

Hi @Fphizal ,

 

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.

vmengmlimsft_3-1723103346966.png

 


The relationship.

vmengmlimsft_4-1723103354081.png

The DAX.

CountDays = DATEDIFF(TableDate1[Designstartdate],RELATED(TableDate2[Datesentforreview]),DAY)

 

The result of my test.

vmengmlimsft_5-1723103365064.png

 


Best regards,
Mengmeng Li

bhanu_gautam
Super User
Super User

@Fphizal , 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)



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

Proud to be a Super User!




LinkedIn






bhanu_gautam
Super User
Super User

@Fphizal , What is the relation between both tables




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

Proud to be a Super User!




LinkedIn






Many to many? Beginner at power bi, any advice how can i calculate the days between two diff data set.

 

@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






Fphizal_0-1723099686094.png

It gives me this

Fphizal_1-1723099739535.png

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors