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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Victoria_Rios
New Member

trouble creating a date hierarchy in Power BI

No reconoce el TipoFecha.pngI'm having trouble creating a date hierarchy in Power BI. I've created a calculated column named 'FechaEntregaCalculada' using the following DAX formula:

FechaEntregaCalculada = DATE(

    YEAR('Archivo de prueba'[Fecha Entrega]),

    MONTH('Archivo de prueba'[Fecha Entrega]),

    DAY('Archivo de prueba'[Fecha Entrega])

)

Despite this, when I right-click on the column and try to create a hierarchy, the option isn't available.

I've already tried the following:

  • Changing the data type: Ensured the calculated column is formatted as a date.
  • Renaming the column: Used a more descriptive name like 'Calculated Delivery Date'.
  • Checking relationships: Verified that the relationships between my tables are correct.
  • Refreshing the model: Tried refreshing the model to see if that would resolve the issue.

I'm not sure what else to try. Any suggestions would be greatly appreciated.

Here are some additional details that might be helpful:

  • Data source: [my  data source Excel]
  • Data format: [fecha]
  • Power BI version: [my  Power BI version is : 2.131.1203.0 64-bit (julio de 2024)]
2 ACCEPTED SOLUTIONS
AmiraBedh
Super User
Super User

Try to create a calculated table as your date dimension :

DateDimension = 
ADDCOLUMNS(
    CALENDAR(DATE(2020,1,1), DATE(2030,12,31)),
    "Year", YEAR([Date]),
    "Month", MONTH([Date]),
    "MonthName", FORMAT([Date], "MMMM"),
    "Quarter", QUARTER([Date]),
    "Day", DAY([Date]),
    "DayOfWeek", WEEKDAY([Date]),
    "WeekDayName", FORMAT([Date], "dddd"),
    "IsWeekend", IF(WEEKDAY([Date], 2) > 5, TRUE, FALSE)
)

 

Link it to your table (consider that it is a fact) and then use the columns from DateDimension and create the hierarchy you want. Don't forget to mark the DateDimension as Date table.


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

View solution in original post

lbendlin
Super User
Super User

There is no need to do this in Power Query or in DAX. Dates are generally immutable.  Create an external reference table that has everything precomputed.

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

There is no need to do this in Power Query or in DAX. Dates are generally immutable.  Create an external reference table that has everything precomputed.

AmiraBedh
Super User
Super User

Try to create a calculated table as your date dimension :

DateDimension = 
ADDCOLUMNS(
    CALENDAR(DATE(2020,1,1), DATE(2030,12,31)),
    "Year", YEAR([Date]),
    "Month", MONTH([Date]),
    "MonthName", FORMAT([Date], "MMMM"),
    "Quarter", QUARTER([Date]),
    "Day", DAY([Date]),
    "DayOfWeek", WEEKDAY([Date]),
    "WeekDayName", FORMAT([Date], "dddd"),
    "IsWeekend", IF(WEEKDAY([Date], 2) > 5, TRUE, FALSE)
)

 

Link it to your table (consider that it is a fact) and then use the columns from DateDimension and create the hierarchy you want. Don't forget to mark the DateDimension as Date table.


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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