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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
akt
Frequent Visitor

Secondary y-axis: calculated average, how not to display those categories in primary axis & legend

I have created a measure to calculate a monthly average for years 2018 and 2019 that I would like to visualize on the secondary axis to compare to monthly counts for more current years (2020-2024) but I don't want the bars for those years (2018-2019) included in the legend/visualized on the graph. However if I filter to exclude those years, my average line also disappears. I have tried to use ALL() and REMOVEFILTERS() on both the counts and the average measures but no dice. I'm sure someone here has a better idea! Thank you!

akt_0-1709763212421.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @akt 

If you want not to display the values on the Line y-axis, you can turn off the display of data labels in visual >> Data label:

vjianpengmsft_0-1709782962651.png

If the value you want to display is the value of your measure, rather than a specific month, try using the following DAX expression:

 

Average_2018_2019 = 
CALCULATE(
    AVERAGE(Table[Value]),
    FILTER(
        ALL(Table[Year]),
        Table[Year] IN {2018, 2019}
    )
)

 

If you don't want to display COUNT1819AVG in the legend, I haven't found any switch to turn off the line Y-axis in the legend. Here is a possible alternative:

vjianpengmsft_1-1709787144928.png

vjianpengmsft_2-1709787185069.png

vjianpengmsft_3-1709787231826.png

vjianpengmsft_4-1709787272696.png

vjianpengmsft_5-1709787356445.png

Turn off the legend field in the original chart and use an independent legend visual, so that the COUNT1819AVG field is not displayed in the legend of the chart.

 

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

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

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi, @akt 

If you want not to display the values on the Line y-axis, you can turn off the display of data labels in visual >> Data label:

vjianpengmsft_0-1709782962651.png

If the value you want to display is the value of your measure, rather than a specific month, try using the following DAX expression:

 

Average_2018_2019 = 
CALCULATE(
    AVERAGE(Table[Value]),
    FILTER(
        ALL(Table[Year]),
        Table[Year] IN {2018, 2019}
    )
)

 

If you don't want to display COUNT1819AVG in the legend, I haven't found any switch to turn off the line Y-axis in the legend. Here is a possible alternative:

vjianpengmsft_1-1709787144928.png

vjianpengmsft_2-1709787185069.png

vjianpengmsft_3-1709787231826.png

vjianpengmsft_4-1709787272696.png

vjianpengmsft_5-1709787356445.png

Turn off the legend field in the original chart and use an independent legend visual, so that the COUNT1819AVG field is not displayed in the legend of the chart.

 

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

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

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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