Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Line chart with each quarter as line

HI All, 

 

I need to create a line chart daily production for each quarter (Q1, Q2.... – one line for Q1 and one line Q2). So the x-axis will simply be the day of the quarter, not the date but the day.  So day 1, day 2, etc so that we can plot the lines similarly.  The objective is to compare production day-wise for every quarter . 

 

I have data in two tables . Table 1 is a date table in which I have added Day of the quarter. Table 2 is a fact table having date of production and quantity produced . The tables hence have 1 to many relationship. 

 

Question:   How an I create a dynamic chart for this? To achive this do I need to create a measure (

Q12021 = CALCULATE(SUM(HSM_COIL[Coil_Tons]), FILTER('Date Table', 'Date Table'[QuarterOfYear] = "Q1 2021"))) 

for each quarter and then plot them as line on the chart?

How do I address the further quarters, eg Q4 2021,  Q1 2022, Q2 2022 etc. ? x

 

Final Chart required

 

 

 

 

Thanks for help,

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous ,

     

    In the calendar table, you can create the calculated column which is the days of the quarter like

    Day = RANKX(FILTER(ALL('Table 2'),[Quarter]=EARLIER('Table 2'[Quarter])),[Date],,ASC,Dense)

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    In the calendar table, you can create the calculated column which is the days of the quarter like

    Day = RANKX(FILTER(ALL('Table 2'),[Quarter]=EARLIER('Table 2'[Quarter])),[Date],,ASC,Dense)

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anonymous's avatar
      Anonymous
      Not applicable

      ThankYou. This was helpful.