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

Combining data and quarter in a column in the form of heirarchy

Hi,

 

Can anyone please help me in creating a date column in the below format:

 

Quarter and month in a heirarchyQuarter and month in a heirarchy

 
1 ACCEPTED SOLUTION

Hello @Anonymous 

 

this has nothing to to with M-language nor DAX. Its the visualisation that craetes the grouping in the data model without you to take any action. So the only important thing is that you in your datamadel somewhere have a row with a date, formated as a date, just like this:

grafik.png

 

you can also create a new table in power BI using this syntax

grafik.png

 

Copy paste this code to the advanced editor to see how the solution works

If this post helps or solves your problem, please mark it as solution.
Kudos are nice to - thanks
Have fun

Jimmy

View solution in original post

4 REPLIES 4
Jimmy801
Community Champion
Community Champion

Hello @Anonymous 

 

this is a grouping that is craeted automatically when a column is placed as rows that is formated as date.

Try this

Copy this to a blank query

let
    Quelle = List.Dates(#date(2019,1,1),600,#duration(1,0,0,0)),
    CreateTable = Table.FromList(Quelle, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    Rename = Table.RenameColumns(CreateTable,{{"Column1", "Date"}}),
    ChangeType = Table.TransformColumnTypes(Rename,{{"Date", type date}})
in
    ChangeType

 

then go to the visuals an place the date-column in a matrix

the date is autmatically grouped like this

grafik.png

 

Delete year and day and show the complete hierarchy. This is the outcome

grafik.png

If this post helps or solves your problem, please mark it as solution.
Kudos are nice to - thanks
Have fun

Jimmy

Anonymous
Not applicable

Thanks. This solution worked, but i was looking to implement it through DAx functions instead of M-query.Can you please help with that

 

Thanks,

Neha Marwaha

Hello @Anonymous 

were you able to solve the problem with any reply given?

If so, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

All the best

Jimmy

Hello @Anonymous 

 

this has nothing to to with M-language nor DAX. Its the visualisation that craetes the grouping in the data model without you to take any action. So the only important thing is that you in your datamadel somewhere have a row with a date, formated as a date, just like this:

grafik.png

 

you can also create a new table in power BI using this syntax

grafik.png

 

Copy paste this code to the advanced editor to see how the solution works

If this post helps or solves your problem, please mark it as solution.
Kudos are nice to - thanks
Have fun

Jimmy

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.

Top Solution Authors
Top Kudoed Authors