Forum Discussion
martinmark
3 months agoNew Member
Date Hierarchy does not get generated
my Date field named created_at is a Date/Time in Power Query when I load the data but not in the model (Data view). Why? How do I make the date hierarchy to get generated automatically? ...
- 3 months ago
martinmark You will have to first create the columns in the table which are required for creating the Date Hierarchy - possible in Direct Query Mode by using DAX. Then, you can use those columns to create a hierarchy as required.
Note - Use MonthNum column to sort MonthName and if you want full Month name you can modify the DAX calculation as required.
Create below DAX Calculated columns in the table in which you have created_at column -
Year = YEAR('Table'[created_at]) Quarter = "Q" & QUARTER('Table'[created_at]) MonthNum = MONTH('Table'[created_at]) MonthName = SWITCH( MONTH('Table'[created_at]), 1, "Jan", 2, "Feb", 3, "Mar", 4, "Apr", 5, "May", 6, "Jun", 7, "Jul", 8, "Aug", 9, "Sep", 10, "Oct", 11, "Nov", 12, "Dec" )💡 Helpful? Give a Kudos 👍 — keep the community growing
✅ Solved your issue? Mark as Solution ✔️ — help others find it faster
Best regards,
Rupasree Achari | BI & Fabric Analytics Engineer
ryan_mayu
Super User
3 months agoyou can create a new column
date2 = DATEVALUE('Table'[date])
then you can see the hierachy for the new column
pls see the attachment below
martinmark
3 months agoNew Member
hi ryan_mayu. unfortunately this does not work as the column used is not recognised as date in the first place