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

Create line chart for Quaterly

Hello,

 

I want to create a line chart for Quarterly;

 

I have 4 column data ;

Q1, Q2, Q3, and Q4 (all the column types are decimal numbers)

 

I don't have a date column, so I create a table for Quarter axis;

Date = CALENDAR(
DATE(2020,1,1),
DATE(2021,1,1)
)

 

of course, I need to create a new measurement to made it show in the line chart.

when I put the column directly to values, it will not represent the quarter

 

yopra_0-1632801661138.png

 

 

anyone could help me with this?

 

Thank you

 

5 REPLIES 5
amitchandak
Super User
Super User

@Anonymous , Based on what I got add additional QTR column in date table and use that

 

Date = addcolumns( CALENDAR(
DATE(2020,1,1),
DATE(2021,1,1)
) ,"Qtr" , "Qtr" & format([Date], "Q"))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi @amitchandak thank you for the reply, but how I can make the line chart with 4 columns as mentioned above 😄

 

yopra_0-1632801721973.png

 

I want to create 1 line chart with 4 dots (following the data from the 4 columns)

Hi @Anonymous ,

You can try:

1. Unpivot these four columns in Power Query first:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("PY65FcAgDEN3oabAByTMwmP/NWLJkMaFji+vVcRKLTbiSI+jo+waaoP6xvEHllM1ZEWgOvxO1SnAUvqaBCSUZWAkuRzS9nOTEJUQesYqxpmdd4hWsJjFmsl973B95u+HEK29Pw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Q1 = _t, Q2 = _t, Q3 = _t, Q4 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Q1", Int64.Type}, {"Q2", Int64.Type}, {"Q3", Int64.Type}, {"Q4", Int64.Type}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {}, "Attribute", "Value"),
    #"Renamed Columns" = Table.RenameColumns(#"Unpivoted Columns",{{"Attribute", "Quarter"}})
in
    #"Renamed Columns"

2. Create a Date table like this:

Date =
ADDCOLUMNS (
    CALENDAR ( "2020/1/1", "2021/1/1" ),
    "Quarter", "Q" & QUARTER ( [Date] )
)

3. Build relationship between these two tables based on the Quarter column.

4. Create a line chart

vyingjl_0-1632982508644.png

 

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

 

Anonymous
Not applicable

Hi @v-yingjl 

Can I put year and custom text after Q1/2/3/4 ?

 

Date =
ADDCOLUMNS (
CALENDAR ( "2020/1/1", "2021/1/1" ),
"Quarter", "Q" & QUARTER ( [Date] )
)
 
Since my Quarter column name format is Q# 2020 - ScoreB, I can't create a relationship between both table

@Anonymous , One way is to have column in you table in Power Query

 

Number.ToText(Date.Year([Date])) &" -Q" & Number.ToText(Date.QuarterOfYear([Date]))

 

And unpivot that in power query

https://radacad.com/pivot-and-unpivot-with-power-bi

 

Or create 4 measure

Q1 2021 = Calculate(Sum(Table[Value]), filter(Date, Date[QTR Year] = "2021-Q1"))

 

Create others 

 

or use time intelligence

 

QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(('Date'[Date])))
Last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,QUARTER)))

 

Last and Last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-2,QUARTER)))

 

 

next QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],1,QUARTER)))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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