Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

View all the Fabric Data Days sessions on demand. View schedule

Reply
Anonymous
Not applicable

average per task_name

Hi,

 

I have a List of Task_Name, and i want  to make the average time for each task_name in the last 15 days.

 

I'm try to create a new column that tell me the average time in tha last 15 days for each task .... 

 

I try this: (but is not working ...)

"

Median of #TAT(Hours) =
VAR currentTaskId = 'Control tasks'[task_name]
RETURN
MEDIANX (
FILTER ( ALL ( 'Control tasks' ), 'Control tasks'[task_name] = currentTaskId ),
DATEDIFF ( 'Control tasks'[start_date], 'Control tasks'[end_date], MINUTE )
)

"

 

can same one help me ?

 

Best regards,

JO

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Create an unrelated calendar table and then you could try some DAX like this:

last_15_days = 
CALCULATE (
AVERAGE(table2[value]),
FILTER (
ALL (table2[date] ),
table2[date] <= MAX ('Table'[Date] )
&& table2[date] >= (MAX('Table'[Date])-15)
)
)

If the problem persists,could you please share the sample pbix and the result you expected?

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Greg_Deckler
Community Champion
Community Champion

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors