Forum Discussion
measure = AVERAGEX(DATEDIFF(DateA, DateB, DAY)) does not work.
- 1 year ago
BTRD Hi!
The main issue is that Measures operate in an aggregated context. The DATEDIFF function expects specific date values, but Measures don't know which rows to calculate on unless you use aggregations or iterate over the table using functions like AVERAGEX.
you can use this measure:
Measure =
AVERAGEX(
YourTableName,
DATEDIFF(YourTableName[DateA], YourTableName[DateB], DAY)
)if you provide me sample data and the expected result i can help you.
BBF
BTRD Hi!
The main issue is that Measures operate in an aggregated context. The DATEDIFF function expects specific date values, but Measures don't know which rows to calculate on unless you use aggregations or iterate over the table using functions like AVERAGEX.
you can use this measure:
Measure =
AVERAGEX(
YourTableName,
DATEDIFF(YourTableName[DateA], YourTableName[DateB], DAY)
)
if you provide me sample data and the expected result i can help you.
BBF