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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
CloudMonkey
Post Prodigy
Post Prodigy

Total average line on line chart

Hi,

 

I have a line chart showing trends by state. Please can you tell me how to draw a national average line (it should undulate each week, not just be a straight horizontal line)

 

Thanks!

 

CM

 

national average.JPG

 

 

1 ACCEPTED SOLUTION

hi, @CloudMonkey 

I'm afraid it couldn't achieve in Power BI for now.

If there is one field in lenged value, it couldn't add two measure into Values.

As a workaround, you could add a new line chart and set the same x-axis and the national average measure.

Then keep two measure X-axis and Y-axis coincident.

 

Best Regards,
Lin

Community Support Team _ Lin
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

7 REPLIES 7
v-lili6-msft
Community Support
Community Support

HI, @CloudMonkey 

You could use “all” functions in DAX to create a national average measure:

https://www.sqlbi.com/articles/managing-all-functions-in-dax-all-allselected-allnoblankrow-allexcept...

 

If not your case, please share some simple sample data and expected output.

 

Best Regards,
Lin

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

Thanks, but woudn't this require a second measure on the y axis? I thought only 1 measure could be put on the y-axis?

hi, @CloudMonkey 

Do you mean that there is a field in legend value, if so, it could not add a measure again.

and you need to use the Analytics pane in Power BI Desktop.

https://docs.microsoft.com/en-us/power-bi/desktop-analytics-pane

 

Best Regards,

Lin

 

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

HI Lin,

 

Analytics pane can create a straight horizontal (average) or angled (trend) line but it can't create a rolling average? The below screenshot shows a horizontal line from the analytics pane and a moving average that I've drawn on in thick black dashed line that I'm aiming for. Does that make sense? (Yes I have a measure in the legend field well)

 

screenshot average 2.JPG

 

Thanks,

 

CM

hi, @CloudMonkey 

I'm afraid it couldn't achieve in Power BI for now.

If there is one field in lenged value, it couldn't add two measure into Values.

As a workaround, you could add a new line chart and set the same x-axis and the national average measure.

Then keep two measure X-axis and Y-axis coincident.

 

Best Regards,
Lin

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

Many thanks Lin, that workaround works for the time being.

hi, @CloudMonkey 

You are welcome. Smiley Very Happy

could you please mark the helpful replies as Answered?

 

Best Regards,

Lin

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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