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
Ritaf
Responsive Resident
Responsive Resident

Calendar "manipulations" on Dax or M language

Hi all,

I need to create a model with calendar which will let me to make calculations based on working days only. I saw few methods to do this in Dax which are pretty simple and Some sophisticated code in M. What is the best practice in this case?

Thanks a lot.

Rita

2 ACCEPTED SOLUTIONS
TomMartens
Super User
Super User

Hey @Ritaf ,

 

basically it's a good idea to create tables in Power Query / M as tables/columns that are created in DAX will suffer some disadvantages. These disadvantages are described in this article:

https://www.sqlbi.com/articles/comparing-dax-calculated-columns-with-power-query-computed-columns/

 

There is an important topic that is not mentioned in the above article and that is the "portability" to a dataflows, providing reusability throughout your company.

 

Personally I start with "DAX", due to the following

  • DAX is still more simple to me than M
  • DAX does not need a full refresh of the table

When I'm done (for the 1st iteration) I port my DAX to M.

 

Hopefully this provides some ideas.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

Hey @Ritaf ,

 

I guess most of us are creating the Calendar table using DAX, and just a few of us have that much rows inside their Power BI SSAS tabular (on-premises / cloud basesd) data models that the points from first post have to be considered.

 

For this I would recommend that you should use DAX until you feel comfortable using DAX, and then start using M, to avoid unnecessary confusion.

 

From my point of view, there is no such thing as a gentle introduction into the world of M (beyond point and click).

My favorite books about Power Query / M are:

These blogs are a wealth of wisdom (but maybe not that easy):

This blog has a lot to offer, without a special order

 

I guess this will keep you from getting bored during the upcoming holidays 🙂

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

3 REPLIES 3
TomMartens
Super User
Super User

Hey @Ritaf ,

 

basically it's a good idea to create tables in Power Query / M as tables/columns that are created in DAX will suffer some disadvantages. These disadvantages are described in this article:

https://www.sqlbi.com/articles/comparing-dax-calculated-columns-with-power-query-computed-columns/

 

There is an important topic that is not mentioned in the above article and that is the "portability" to a dataflows, providing reusability throughout your company.

 

Personally I start with "DAX", due to the following

  • DAX is still more simple to me than M
  • DAX does not need a full refresh of the table

When I'm done (for the 1st iteration) I port my DAX to M.

 

Hopefully this provides some ideas.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Ritaf
Responsive Resident
Responsive Resident

Hi ,

Thank you for your explanations. 

Eventually ia did it on dax, because of lack of M knowledge, it just didn't work  in other way.

May be you have a recomendation of course / book/ guide of M language.

 

Today i am able to use only functions with "buttons" without writing code.

Hey @Ritaf ,

 

I guess most of us are creating the Calendar table using DAX, and just a few of us have that much rows inside their Power BI SSAS tabular (on-premises / cloud basesd) data models that the points from first post have to be considered.

 

For this I would recommend that you should use DAX until you feel comfortable using DAX, and then start using M, to avoid unnecessary confusion.

 

From my point of view, there is no such thing as a gentle introduction into the world of M (beyond point and click).

My favorite books about Power Query / M are:

These blogs are a wealth of wisdom (but maybe not that easy):

This blog has a lot to offer, without a special order

 

I guess this will keep you from getting bored during the upcoming holidays 🙂

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

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.