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
Burningsuit
Resident Rockstar
Resident Rockstar

Calculated Columns in DAX, why?

Can anyone give a good reason (other than backwards compatability) for using calculated columns in DAX?

As I see it, I can create columns in Query (Which get compressed into the data model) for everything I need, rather than creating calculated columns in DAX (which may not get compressed, hence inflating the data model). For everything else there's Measures. So I'm struggling to find a use case for DAX Column Calculations, or have I missed something?

 

regards

 

Stuart

1 REPLY 1
Greg_Deckler
Super User
Super User

There are a number of reasons but probably primarily ease of use. There are certain things that are just easier to do in DAX rather than in "M" code. A good example of this is dealing with dates and times. For certain things it is 1 line of DAX versus multiple complex lines of M code. In addition, DAX is very Excel formula like. M is a complex, functional programming language and the Query Editor does not provide easy access to perhaps 50-60% or more of what M is capable of. And not everyone is a developer out there.

 

Also remember that DAX is part of SQL Server Analysis Services Tabular. So it's application goes beyond Power BI. Power BI just happens to use SSAS Tabular under the hood so DAX kind of comes along for the ride. 


@ 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.