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

Win a FREE 3 Day Ticket to FabCon Vienna. Apply now

Reply
Anonymous
Not applicable

Create average line from analytics using a measure

Hi all,

 

I have a visual that tracks how long it takes a technical service center to resolve various faults using a line and stacked column chart.

Bi average line.png

The solid line is the average time it take to solve a specific fault. I would like the dashed line to be the average resolution time across all cases but unfortunetly, the line and stacked column chart doesn't support analytics. To resolve this, I made a column that just measures the average of all cases in the query:

 

Dwell = AVERAGE('Case File Data'[Dwell (days)])

 

and set the line value to average but this means that the average line will not dynamically adjust as I input values in slicers. It just stays at 6.1 days.

 

Is there a way to write a measure that will create a flat average line similar to the one from the analytics tab from other visuals? I'm new to BI and haven't been able to find an answer searching.

 

I've tried to write a measure to produce a flat line using 2 measures:

 

Total dwell = SUM('Case File Data'[Dwell (days)])

 

 

Average Dwell = AVERAGEX(ALL('Case File Data'),[Total dwell])

 

I feel like that should produce a flat line but it just matches the other one like this: 

average dwell broken flat line.png

 

Thanks,

 

Robbie

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Have tried a line with allselected ?

Try Like

Dwell = calculate( AVERAGE('Case File Data'[Dwell (days)]) , allselected('Case File Data'))
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak 

 

I had previously tried that just using ALL rather than ALLSELECTED, but I gave your suggestion a try just in case. It seems to also produce a line that matches the line measuring the average per fault rather than a flat reference line.

 

BI Forum suggestion.png

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.