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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Average on a graph unaffected by day

Spoiler
Hi all,
I have created an average measure in Power BI and then using this measure have created two more measures that are 20% above and 20% below this average. This is visible in the table above the bar chart and also changes based on the day of the week selected as well as the quarter selected on the slicers below the bar chart (as shown by the first 2 screenshots).
Currently however, when i add this measure to the bar chart the average changes day by day (as shown in the 3rd screenshot). I do not want this and i want it to be able to stay the same as it is shown in the table above the bar chart but instead as a solid line all the way along the bar chart. And I only want this average to change when selecting the 2 slicers that are on the page but still remain as a solid line across the bars.

Essentially how do i get the average line highlighted in the 4th screenshot as a measure and also 2 more lines that do the same thing for 20% and 20% below that average.

Please could you advise on whether this would be possible and how i would go about doing this if so. 

Thanks


Screenshot 1Screenshot 1Screenshot 2Screenshot 2Screenshot 3Screenshot 3Screenshot 4Screenshot 4
 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Greg_Deckler I have just used the filter to only show total visitors when the value is "not blank" and that has fixed it for me.

 

Thank you for your help with everything though!

View solution in original post

9 REPLIES 9
Greg_Deckler
Community Champion
Community Champion

@Anonymous What do your measures look like? Generally you can use something along these lines:

Measure Average = AVERAGEX( ALL('Table'), [Value] )


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...
Anonymous
Not applicable

@Greg_Deckler, My measures look like this

 

Screenshot 5 for average footfall.png

 

Screenshot 6 for average footfall.png

@Anonymous Try:

AverageFootFall = AVERAGEX( ALL('Priority Zone'), [total visitors] )

Your other measures can remain the same.



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...
Anonymous
Not applicable

@Greg_Decklerthe only issue is when i do that, the average stays the same regardless of what i select on the slicers. So it is not dynamic as I wish it to be. The graph also becomes quite gapped. 

 

Screenshot 7 for average footfall.pngScreenshot 8 for average footfall.png

@Anonymous Use ALLSELECTED then instead of ALL. So like:

AverageFootFall = AVERAGEX( ALLSELECTED('Priority Zone'), [total visitors] )

 



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...
Anonymous
Not applicable

@Greg_DecklerThanks that has worked, the only thing now is the graph still looks like this.Screenshot 9 for average footfall.pngI dont suppose you know how i would go about making it so there was no gaps between the bars when only selecting one day?

 

Thanks for your help.

@Anonymous Ah, well, you could try changing the x-axis to categorical instead of continuous.



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...
Anonymous
Not applicable

@Greg_Deckler I have just used the filter to only show total visitors when the value is "not blank" and that has fixed it for me.

 

Thank you for your help with everything though!

@Anonymous That's a great solution!



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
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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