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.
Hi,
I have a table as on the picture and need to calculate the average difference between the start date and the end date, by supplier excluding rows with a start date after the end date and excluding rows whose start date/end date is"31/12/1899".
I tried the dax below, but it gives me incorrect results, how can I correct it?
Solved! Go to Solution.
Hi,
Please try the below measure.
TestAverage =
AVERAGEX (
FILTER (
Sheet1,
Sheet1[StartDate] < Sheet1[EndDate]
&& NOT ( Sheet1[StartDate] = DATE ( 1899, 12, 31 ) )
&& NOT ( Sheet1[EndDate] = DATE ( 1899, 12, 31 ) )
),
DATEDIFF ( 'Sheet1'[StartDate], Sheet1[EndDate], DAY )
)
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.
It worked !! Thank you!
Hi,
Please try the below measure.
TestAverage =
AVERAGEX (
FILTER (
Sheet1,
Sheet1[StartDate] < Sheet1[EndDate]
&& NOT ( Sheet1[StartDate] = DATE ( 1899, 12, 31 ) )
&& NOT ( Sheet1[EndDate] = DATE ( 1899, 12, 31 ) )
),
DATEDIFF ( 'Sheet1'[StartDate], Sheet1[EndDate], DAY )
)
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.
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 |
---|---|
117 | |
104 | |
77 | |
73 | |
50 |
User | Count |
---|---|
145 | |
109 | |
108 | |
90 | |
64 |