Forum Discussion
Anonymous
4 years agoNot 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 f...
Anonymous
4 years agoNot applicable
Hi amitchandak thank you for the reply, but how I can make the line chart with 4 columns as mentioned above 😄
I want to create 1 line chart with 4 dots (following the data from the 4 columns)
v-yingjl
4 years agoCommunity Support
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
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.
- Anonymous4 years agoNot 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