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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
zdenek_moravec
Frequent Visitor

Hide average line in column chart when only one bar is displayed

Dear colleagues

I have a column chart with a date on x-axis and count of orders on the y-axis. I would like to display an average line over the bars, which displays an average value of the displayed bars values.

An easy solution is to switch to “clustered column chart”, which allows to enable average line on the “further analysis” tab. Everything looks good:

zdenek_moravec_3-1740471834667.png

until the x-axis shows only one period (one day, one month or one year). Then the avg line is distracting and actually useless:

zdenek_moravec_4-1740471953622.png

So my question is, how to set a column chart with an average line, which disappears, when the chart shows only one value/bar. 

See example AVG line in stacked column chart in case of one value.pbix.

I believe in a measure, which can detect number of periods displayed and which calculates the average of the bar values or sets the line value to blank based on count of displayed periods. One constrain is, that the date x-axis is managed by field parameters.

Thank You very much for any hint.

Zdenek Moravec

Cesky Krumlov, Czechia

0 REPLIES 0

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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