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 folks.
I have a column called “DaysBetween” that calculates the days between two date columns in my table:
TableName[StartDate] and TableName[EndDate].
My date range starts from 19/04/2019 to the present day.
I want to create an Average Days measure that calculates how many weekdays it took to complete a task(s), but only display the average. I also just want to record the data from 01/04/2020 onwards.
For example, if 700 tasks have been completed, I want to get the average number of weekdays it took to complete the tasks.
I have created an “AverageDays” measure (see below):
AverageDays = CALCULATE(AVERAGE(TableName[DaysBetween]), all(TableName[EndDate])
However, the above measure calculates the average over my entire dataset, I just want the average to start from 1st April 2020.
Can this be done?
Many thanks,
Solved! Go to Solution.
Hi @SteCra100 ,
DATESYTD(<dates> [,<year_end_date>])
You may try:
IF(MAX(Table1[InsertDateColumbNameHere].[Date])>"01/04/2020",
CALCULATE(AVERAGE(Table1[InsertColumnNameHere]), DATESYTD( Table1[InsertDateColumbNameHere].[Date])))
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@SteCra100 , refer 2nd page , working date diff of the attached file after signature if that can help
Hello @amitchandak
Many thanks for your quick reply. I'm afriad I can't downlaod your .phix file as it says i'm not on the correct version. Are you able to guide me what measure you used?
Many thanks,
Hello @amitchandak
I have been looking into this more, and I have used the following syntax:
Hi @SteCra100 ,
DATESYTD(<dates> [,<year_end_date>])
You may try:
IF(MAX(Table1[InsertDateColumbNameHere].[Date])>"01/04/2020",
CALCULATE(AVERAGE(Table1[InsertColumnNameHere]), DATESYTD( Table1[InsertDateColumbNameHere].[Date])))
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
111 | |
95 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |