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
aashton
Helper V
Helper V

Adding Linear Trend line to bar chart

Hello,

I have a bar graph with the Month/Year on the x-axis, and three measures on the y.   The user is asking for a linear trend line of one of the measures.  Not really sure what that means?

This is what the bar graph looks like now, with and without a line for the Total Applications.  

aashton_0-1712782689157.png

aashton_1-1712782726449.png

 

This is the users example of how she wants it to look:  

aashton_2-1712782778288.png

 

I'm thinking it's just a nice straight line because those numbers only go up.  In reality, Total Applicatoins go up and down.  Would a linear line look at the first month of 238 and the last month of 75 and just have a straight line pointing in the down direction?  How would I do that?

 

1 ACCEPTED SOLUTION
ToddChitt
Super User
Super User

Am I correct in stating that the user's sample has nothing to do with the two graphs above it? It is only to indicate that she wants a straight line between the first and last points (238 and 75)?

Start out by just entering some hard numbers into a new DAX table: two rows (first month and last month) and their respective values 238 and 75. Join that to the common x Axis date dimension. See what happens when you plot it on top of your columns (Yes, that is a COLUMN CHART, not a BAR CHART. Bar charts go horizontal.)

Now try to recreate that table with a SUMMARIZE DAX statement, with fancy FILTER statements that filter for first and last month only.

Hope that helps.




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





View solution in original post

3 REPLIES 3
v-kongfanf-msft
Community Support
Community Support

Hi @aashton ,

 

May I ask whether the problem has been solved? If so, please mark it as the correct solution, and point out if the problem persists.

 

Best Regards,
Adamk Kong

ToddChitt
Super User
Super User

Am I correct in stating that the user's sample has nothing to do with the two graphs above it? It is only to indicate that she wants a straight line between the first and last points (238 and 75)?

Start out by just entering some hard numbers into a new DAX table: two rows (first month and last month) and their respective values 238 and 75. Join that to the common x Axis date dimension. See what happens when you plot it on top of your columns (Yes, that is a COLUMN CHART, not a BAR CHART. Bar charts go horizontal.)

Now try to recreate that table with a SUMMARIZE DAX statement, with fancy FILTER statements that filter for first and last month only.

Hope that helps.




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





@ToddChitt  Yes, you are correct, that second chart was just an example.  Thank you for the explanation, I'll try to work that out.

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.