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
j_w
Helper IV
Helper IV

Trend line is not available when field type is text or x-axis type is not continuous?

Trend line is not available when field type is text or x-axis type is not continuous.

 

For Years, trend line works:

trend line 01.png

trend line 02.pngtrend line 03.png

 

But for quarters and months don't work:

trend line 04.pngtrend line 05.png

 

What is the solution for quarters and months?

6 REPLIES 6
anonymuser
New Member

Hey there! I've looked everywhere and honestly couldn't find a solution but I somehow managed to work it out somehow.. hopefully this is the issue you're looking for to solve.

This is like my 3rd time using Power BI so please excuse if im wrong.

 

The issue is that you can only use a Trendline if your X-Asis is numerous - but dont worry I got a fix where its numerous but will still show "Jul 2017" as an example.

 

1. Create Column Month-Year: 

 

 

 

Month-Year = FORMAT([Date],"MM-YYYY")​

 

 

 

2. Set Column Format to yyyy-mm
anonymuser_1-1665482860908.png

3. Create Column for Order:

 

 

 

Order = YEAR([Date])*100+MONTH([Date])

 

 

4. Sort Column Month-Year by Order
anonymuser_2-1665483005751.png

5. Add Month-Year to the X-Axis first. ( DO NOT ADD ORDER - works added too but drilldown works bad? ) 
anonymuser_5-1665483610925.png

 

6. Enable Trendline 🙂 

 



I hope this is actually what you're looking for and sorry that im a bit late. Please let me know.


- Anonymuser

 

@j_w @Anonymous 

 
Anonymous
Not applicable

Did you ever find a solution to this? I too Have text field for Qtr-Wk ( Q3-04) and need to place a trend line.

Anonymous
Not applicable

Hi @j_w

 

Have you tried using the date hierarchy?

Date Hierarchy.png

 

 

 

Hi @Anonymous

 

Thanks, tried Quarter and Month from a date hierarchy, but still not working.

 

And the in the report, the financial year (starts from April) first quarter includes Apr, May and Jun, which is not equal to the quarter in date hierarchy.

 

 

Anonymous
Not applicable

Hi @j_w

 

You can convert month to date and it should work, it works for me. 

 

For quarter, you could change the format a little. Try Qtr2 = right(Table1[Qtr],4)&left(Table1[Qtr],5). Now the sorting would work (See screenshot below).

Date sorting.png

 

Hi @Anonymous

 

Thanks for your ideas.

 

I guess you might misunderstood my question, I want to enable "adding trend line" for quarters and month but not sorting.

 

 

I tried your ideas, "adding trend line" is still not available:

 

X-Axis has no Type optionX-Axis has no Type optionAnalytics has no Trend Line optionAnalytics has no Trend Line option

 

Thanks.

 

 

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.