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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply

Transform .vs. DAX for a Datetime column I want to convert into hierarchy

I have a DateTime column in a table, in format "dd/mm/yyyy hh:mm:ss", loaded as DirectQuery, whith about 2 million rows. Is part of a model with other tables.

 

I want to create a date hierarchy (year, mont, day, week, hour... and so on) for my model.

 

Wich is a better solution, to TRANSFORM the table with M (creating Year, Month, Day, hour... and so on), or create the measures directly with DAX from the original datetime column? (as far as I can see, using M to extract Date and Time is not permited in DirectQuery, only import)

 

Thanks!

1 REPLY 1
Greg_Deckler
Super User
Super User

@Francisco_G_Cal Generally you want to do that kind of transformation in M. Also, it would be best practice to actually have a date table with all of those transformations in it and then relate it to your fact table. 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.