Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello everyone!
I'm working on a PBI dataset and I have 2 columns with date type rows. For each row, I need to calculate how many days are beetween those 2 dates.
Could anyone of you please tell me if there's any calculated measure I can use to do so?
Wish you all a very nice day!
Solved! Go to Solution.
Hi @PBI_Student ,
There are the following ways to achieve this:
Create measure:
DATEDIFF = DATEDIFF(MAX('Table'[Date1]),MAX('Table'[Date2]),DAY)
INT = ABS( INT(MAX('Table'[Date1])-MAX('Table'[Date2])))
1ABS = ABS( 1 * (MAX('Table'[Date1]) - MAX('Table'[Date2])))
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @PBI_Student ,
There are the following ways to achieve this:
Create measure:
DATEDIFF = DATEDIFF(MAX('Table'[Date1]),MAX('Table'[Date2]),DAY)
INT = ABS( INT(MAX('Table'[Date1])-MAX('Table'[Date2])))
1ABS = ABS( 1 * (MAX('Table'[Date1]) - MAX('Table'[Date2])))
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@PBI_Student ,You can sue DATEDIFF for calculting a no. of days between two dates range.https://docs.microsoft.com/en-us/dax/datediff-function-dax
No. of Days =DATEDIFF(MIN( Calendar[Date] ), MAX( Calendar[Date]), DAY )
@PBI_Student , what you mean by -2 columns with date type rows?
Usually Datediff can help
Measure
Sumx(Table, datediff([Date1], [Date2], day))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
102 | |
100 | |
77 | |
69 | |
62 |
User | Count |
---|---|
141 | |
106 | |
101 | |
85 | |
72 |