Forum Discussion

Analitika's avatar
Analitika
Icon for Post Prodigy rankPost Prodigy
5 years ago
Solved

CALENDAR(<start_date>, <end_date>)

Why CALENDAR(<start_date>, <end_date>)  show in visual chart Quarter as QTR instead of Q ?  Custom formating does not help as i cant move custom Quarter = Format(Date[date], "\QQ") to Date hierachy

10 Replies

    • Analitika's avatar
      Analitika
      Icon for Post Prodigy rankPost Prodigy

      here auto created QTR i need Q

      if i put custom created Quarter with Q  it concatenate year value

       

       

      • amitchandak's avatar
        amitchandak
        Icon for Super User rankSuper User

        Analitika , make sure both year and qtr column has the sort column(numeric) or they are sortable

         

        Then switch off concatenate labels (sorting is important)

         

  • Hi Analitika ,

     

    You can use below DAX for the same.

    CustomQtr = FORMAT('Table 2'[Date],"\Qq") ---Output will be Q1
     
     
    This will give default format 
    Column 2 = 'Table 2'[Date].[Quarter]  --Output will be Qtr 1
     
    Regards,
    Amit
      • amikm's avatar
        amikm
        Icon for Helper V rankHelper V

        Hi Analitika,

         

        Create a table like this and use in your visual-
        Date =
        ADDCOLUMNS (
        CALENDAR (DATE(2019,01,01); DATE(2020,12,31));
        "DateAsInteger"; FORMAT ( [Date]; "YYYYMMDD" );
        "Year"; YEAR ( [Date] );
        "Monthnumber"; FORMAT ( [Date]; "MM" );
        "YearMonthnumber"; FORMAT ( [Date]; "YYYY/MM" );
        "YearMonthShort"; FORMAT ( [Date]; "YYYY/mmm" );
        "MonthNameShort"; FORMAT ( [Date]; "mmm" );
        "MonthNameLong"; FORMAT ( [Date]; "mmmm" );
        "DayOfWeekNumber"; WEEKDAY ( [Date] );
        "DayOfWeek"; FORMAT ( [Date]; "dddd" );
        "DayOfWeekShort"; FORMAT ( [Date]; "ddd" );
        "Quarter"; "Q" & FORMAT ( [Date]; "\Qq");
        "YearQuarter"; FORMAT ( [Date]; "YYYY" ) & "/Q" & FORMAT ( [Date]; "Q" )
        )

         

        Regards,
        Amit

  • v-easonf-msft's avatar
    v-easonf-msft
    Icon for Community Support rankCommunity Support

    Hi, Analitika 
    Your current date hierarchy is created  based on / under the original "date" with the default format hierarchy.

    You need to   create another hierarchy based other fields, then add the hierarchical fields you need such as date,year, quarter, and month.So that the hierarchy is independent of the original "Date" field.

     

    For more details,please check attached pbix file.

     

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

     

    • Analitika's avatar
      Analitika
      Icon for Post Prodigy rankPost Prodigy

      It not possible to do with custom calendar