Forum Discussion
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(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
anyone could help me with this?
Thank you
5 Replies
- amitchandakSuper 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"))- AnonymousNot 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)
- amitchandakSuper User
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)))