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

Year and month Hierarchy

I want to create a year and month hierarchy in the following order
Year

      Tertial 1

         January

        February

        March

        April

     Tertial 2

             May

             June

             July

             August

  

      Tertial 3

            September 

            october

            November

            December

How can I create this kind of Hierarchy?

I couldn't manage to put the tertial names under the year and put the months below.

All the Tertials are under year column and each Tertial contains months

.

2 ACCEPTED SOLUTIONS
v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

Add the following calculated column and refer to this demo.

Tertial =
VAR m =
    MONTH ( 'Table'[Date] )
RETURN
    SWITCH ( TRUE (), m <= 4, "Tertial 1", m <= 8, "Tertial 2", "Tertial 3" )
Community Support Team _ Sam Zha
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

Anonymous
Not applicable

You can create a month number column and then use it to sort the your current Month.

2018-09-14_17-02-03.png

 

 

 

View solution in original post

7 REPLIES 7
v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

Add the following calculated column and refer to this demo.

Tertial =
VAR m =
    MONTH ( 'Table'[Date] )
RETURN
    SWITCH ( TRUE (), m <= 4, "Tertial 1", m <= 8, "Tertial 2", "Tertial 3" )
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you for your reply!

I want to have a hierarchy like an image below, so I created another calculated column using the following formula."Month = IF('table'[Tertial]="tertial 1";[Datum].[Month];IF('table'[Tertial]= "tertial 2";[Datum].[Month];[Datum].[Month]))" and it gave me the results like the image below, but the month names are not in the right order.how can I sort the month names?

Skärmklipp.PNG

 

Anonymous
Not applicable

You can create a month number column and then use it to sort the your current Month.

2018-09-14_17-02-03.png

 

 

 

Anonymous
Not applicable

I did that, but it still gives me the same results when I put it in the hierarchy.

Anonymous
Not applicable

Are you using Hierarchy Slicer visualization?  This can work well in my test env.

2018-09-14_17-33-04.png

 

 

 

Anonymous
Not applicable

I recreate another hierarchy slicer and it works fine!

Thanks!

Anonymous
Not applicable

I used this formula to get month numbers from the tertial column so that I can get the months in the right order. Is there a way to format or change the month numbers to month name on this formula?

=SWITCH([Tertial];"Tertial 1";MONTH([Datum]);"Tertial 2";MONTH([Datum]);MONTH([Datum]))

 

Thanks in advance!

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.