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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
mich32
Frequent Visitor

How to have Year/Qtr on a Continuous X Axis

Hi Community,

I am banging my head on this one.  I've researched so much I may have missed the solution.  All I want to do is chart a line chart with 2 historical trend lines and then 2 basic linear trend lines for each of the 2 historical trend lines as show below.  I realize that the x-axis has to be a date or number in order for a trend line to be available in the Analytics pane, but I cannot get to the point with what I have all tried.

 

mich32_0-1659040320135.png

The snapshot below shows how far I get, but you can see that the x-axis does not contain the quarter, it just contains the year.  How I got to this point was by using DAX of Quarter = STARTOFQUARTER(Table[Date]).

 

mich32_1-1659040610952.png

 

Please, if anyone can help me out, it would be greatly appreciated!!!! 

4 REPLIES 4
Chainfire74
Helper I
Helper I

If you create a new date table using the code below, you can then use the YearQuarter column in the X axis. There are few other options to play around with in the table too.

 

EX TABLE =
ADDCOLUMNS (
CALENDAR (DATE(2000,1,1), DATE(2030,1,1)),
"DateAsInteger", FORMAT ( [Date], "YYYYMMDD" ),
"Year", YEAR ( [Date] ),
"Monthnumber", FORMAT ( [Date], "MM" ),
"YearMonthnumber", FORMAT ( [Date], "YYYY/MM" ),
"YearMonthShort", FORMAT ( [Date], "YYYY/mmm" ),
"MonthNameShort", FORMAT ( [Date], "mmm" ),
"MonthNameLong", FORMAT ( [Date], "mmmm" ),
"DayOfWeekNumber", WEEKDAY ( [Date] ),
"DayOfWeek", FORMAT ( [Date], "dddd" ),
"DayOfWeekShort", FORMAT ( [Date], "ddd" ),
"Quarter", "Q" & FORMAT ( [Date], "Q" ),
"YearQuarter", FORMAT ( [Date], "YYYY" ) & "/Q" & FORMAT ( [Date], "Q" )
)


)


@Chainfire74 - Thank you for responding with this option, however, I tried it out and I get the x-axis to read properly, but then I lose the ability to show a trend lines as you see here in my snapshot.  The trend line option goes away cause the x axis switches to categorical (purple arrow).  Any other thoughts? 🙄

mich32_0-1659112714671.png

 



mich32
Frequent Visitor

@MattAllington - Hey Matt, saw that you are a MVP and just can't find a solution to my issue.  Can you please take a look and see if you know how to help?  I also just submitted a sample file of the data that I'm working with.  Thank you!!!!

https://gppower-my.sharepoint.com/:u:/g/personal/michelle_miller_evergy_com/EbY_Q8tzaedMj0weYNRKEr0B...

mich32
Frequent Visitor

@amitchandak - Do you know the solution to my issue by chance?  

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.