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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Calculate averag load time per month and create a trendline for 2021 and 2022

Now my issue is I try to calculate Average Load Time - I need to measures one for 2021 and one for 2022 as I want to use them in the 2 line trendline. But I get exactly the same result...why?
What I want i to build a trendline month by month similar to this one:
justyna_kmiecik_0-1653320085101.png

 

 

 
 
Avg Completion Time 2021 = CALCULATE(
AVERAGE('Daily Issues'[LoadTime]),'Date Table'[Year]=MAX('Date Table'[Year])-1)
 
Avg Completion Time 2022 = CALCULATE(
AVERAGE('Daily Issues'[LoadTime]),'Date Table'[Year]=MAX('Date Table'[Year]))
 
My table is linked to Date Table but I also have Year in my original parent table:
 
justyna_kmiecik_1-1653320085297.png

 

I also tried this but not ok...

 

AverageMonthLoad = AVERAGE('Daily Issues'[LoadTime])/DISTINCTCOUNT('Date Table'[Month Sort])
 
my date table looks like this:
 
justyna_kmiecik_2-1653320148546.png

 

3 REPLIES 3
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

Could you please provide more details about your Daily Issues table to help us clarify your scenario?

Like the columns fields, the relationship between Daily Issues table and Date table and your expected average values.

Or if possible, please share me with your pbix file after removing sensitive data.

Refer to:

How to Get Your Question Answered Quickly - Microsoft Power BI Community

How to provide sample data in the Power BI Forum - Microsoft Power BI Community

 

 

Best Regards,
Eyelyn Qin

Anonymous
Not applicable

ot working....the result still shows a generic average and not per month as you see, and also not separated by year...I need to filter 2022 or 2021 to see the actual result, but anyway I need to see average per month

justyna_kmiecik_0-1653377955138.png

 

 

 

amitchandak
Super User
Super User

@Anonymous , try like

 

AverageX (values('Date Table'[Month Sort]), calculate(AVERAGE('Daily Issues'[LoadTime]),'Date Table'[Year]=MAX('Date Table'[Year])-1))

 

or

 

 

calculate(AverageX (values('Date Table'[Month Sort]), calculate(AVERAGE('Daily Issues'[LoadTime])),'Date Table'[Year]=MAX('Date Table'[Year])-1))

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors