Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Line Graph With Multiple Years of Data

I am trying to graph material utilization for our factory as line graph. Each line will represent the utilization percentage by month for each year in the data. The month along the x-axis will run No...
  • adambhappy's avatar
    adambhappy
    6 years ago

    I've fixed the calculation for the Fiscal Year (reversed it the first time) and I've added a column called Fiscal Year Month Number, select the Month Name in the table and then change the Sort by Column to Fiscal Year Month Number.

     

    dates = 
    VAR vMinYear = 2010
    VAR vMaxYear = 2030
    RETURN
    ADDCOLUMNS (
            CALENDAR(DATE(vMinYear;1;1);DATE(vMaxYear;1;1));
        "Calendar Year"; "CY " & YEAR ( [Date] );
        "Calendar Year Number"; YEAR ( [Date] );
        "Fiscal Year"; "FY " & IF(MONTH([Date])>10;YEAR([Date])+1;Year([Date]));
        "Fiscal Year Number"; IF(MONTH([Date])>10;YEAR([Date])+1;Year([Date]));
        "Fiscal Year Month Number";IF(MONTH([Date]<11);Month([Date])+10;Month([Date]));
        "Month Name"; FORMAT ( [Date]; "mmmm" );
        "Month Number"; MONTH ( [Date] )
    )

     

     

    Then you can change the visualization to sort by month name and make sure the sorting is descending.