Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Month Year in Hirarchy

Hello Expert,
1st step to create calendar using below mentioned scripts . which will give hirachy also

Table2 = CALENDAR(DATE(2016,1,1),DATE(2019,12,31))

2nd step create a column 
Format('Table 3'[Date],"MMM-YY")

and add month- year column in hirarchy or tell me the alternate step where we can add month-year column in hirarchy

 

Shree

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

You could add date column in a table or matrix visual, then select "date hierarchy".

Capture28.JPG

if you want the month to display as "MMM-YY" format, you could create the table as below

Capture29.JPG

 

Table2 =
ADDCOLUMNS (
    CALENDAR ( DATE ( 2016, 1, 1 ), DATE ( 2019, 12, 31 ) ),
    "year", YEAR ( [Date] ),
    "month", MONTH ( [Date] ),
    "day", DAY ( [Date] ),
    "MMM-YY", FORMAT ( [Date], "MMM-YY" ),
    "quarter", SWITCH (
        TRUE (),
        MONTH ( [Date] ) <= 3, "Qtr 1",
        MONTH ( [Date] ) <= 6, "Qtr 2",
        MONTH ( [Date] ) <= 9, "Qtr 3",
        MONTH ( [Date] ) <= 12, "Qtr 4"
    )
)
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

You could add date column in a table or matrix visual, then select "date hierarchy".

Capture28.JPG

if you want the month to display as "MMM-YY" format, you could create the table as below

Capture29.JPG

 

Table2 =
ADDCOLUMNS (
    CALENDAR ( DATE ( 2016, 1, 1 ), DATE ( 2019, 12, 31 ) ),
    "year", YEAR ( [Date] ),
    "month", MONTH ( [Date] ),
    "day", DAY ( [Date] ),
    "MMM-YY", FORMAT ( [Date], "MMM-YY" ),
    "quarter", SWITCH (
        TRUE (),
        MONTH ( [Date] ) <= 3, "Qtr 1",
        MONTH ( [Date] ) <= 6, "Qtr 2",
        MONTH ( [Date] ) <= 9, "Qtr 3",
        MONTH ( [Date] ) <= 12, "Qtr 4"
    )
)
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.