Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Good afternoon
I am trying to get the number of days between two dates selected by two independent filters (Date 1 and Date 2), which take the values of two different tables:
What would be the corresponding function to calculate the number of days between the two dates?
Thank you very much, greetings.
Solved! Go to Solution.
Hi,
Please check the below picture and the attached pbix file.
Days measure: =
ABS (
INT ( SELECTEDVALUE ( Dates1[Dates1] ) - SELECTEDVALUE ( Dates2[Dates2] ) )
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi @Syndicate_Admin ,
Please try the DATEDIFF function:
Measure = DATEDIFF(MAX( Calendar1[Date1] ), MAX( Calendar2[Date2]), DAY )
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Please check the below picture and the attached pbix file.
Days measure: =
ABS (
INT ( SELECTEDVALUE ( Dates1[Dates1] ) - SELECTEDVALUE ( Dates2[Dates2] ) )
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Good morning
I have tried to enter the formula that you put me and it only shows me a '0', if on both dates I put the same day, if it does not show me a 'blank'. I am working on the Power Bi version (January 2020) and my date format is the same for both filters and is as follows:
Thank you very much, greetings.
Hi @Syndicate_Admin ,
Please try the DATEDIFF function:
Measure = DATEDIFF(MAX( Calendar1[Date1] ), MAX( Calendar2[Date2]), DAY )
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.