DAX Query Basics

  • gary.strange-sqlconsumer

    SSCommitted

    Points: 1811

    Comments posted to this topic are about the item DAX Query Basics

  • Raunak Jhawar

    SSCoach

    Points: 15701

    Nice and handy. Thank you.

    Raunak J

  • SQLKnowItAll

    SSC Guru

    Points: 61781

    Nice article! However, I have no idea what DAX is... I can query it now, but I don't know where or why I would 🙂 I could Google it, but you may want to include it in your introduction.

    Thanks,
    Jared
    PFE - Microsoft
    SQL Know-It-All
    How to post data/code on a forum to get the best help - Jeff Moden[/url]

  • ssmith 73361

    Grasshopper

    Points: 21

    ^ My thoughts exactly.

  • loren.saunders

    SSC Enthusiast

    Points: 156

    DAX query...

    Hm... it reminds me of Django or other object oriented type programming languages where readability has been reduced to a minimum so that people can do things in "one line of code".

    While elegant looking... it's very hard to read, unless you know by heart the parameters of the built in functions.

    I much prefer a good, structured query language statement which is easily readable by any one coming across it (including myself) even years and years later... because each clause of the statement is going to have the same purpose/function no matter what, is called out by name (select, from, where, order by, group by etc).

    While object oriented code is more elegant at first glance, and people can brag about how they were able to build an interface in 15 minutes with a few choice, built in objects and functions... my concern is that in 15 years people will look at that code and be unable to read it.

    I would put this DAX language and syntax there as well... in the elegant but eventually undecipherable category.

    That's my rant in any case.

  • Steve Jones - SSC Editor

    SSC Guru

    Points: 720484

  • gary.strange-sqlconsumer

    SSCommitted

    Points: 1811

    Hi,

    Thanks for all your comments and feedback.

    I guess that DAX is still new and that not everyone is immediately aware of its existence. I will perhaps include more back ground information in any future articles.

    Regarding the language I feel that it is certainly not the easiest to learn and master. But when I come to re-visit my queries in 15 years times I'm sure I would have left plenty of useful comments like we all do, right? :doze:

    I certainly find it more palatable than MDX and it's easier to visualize intermediate query results in my head when authoring a query. I guess it comes down to personal experience, some people write c# and can't stand VB.net and vice versa.

  • gary.strange-sqlconsumer

    SSCommitted

    Points: 1811

    Hi,

    Thanks for all your comments and feedback.

    I guess that DAX is still new and that not everyone is immediately aware of its existence. I will perhaps include more back ground information in any future articles.

    Regarding the language I feel that it is certainly not the easiest to learn and master. But when I come to re-visit my queries in 15 years times I'm sure I would have left plenty of useful comments like we all do, right? :doze:

    I certainly find it more palatable than MDX and it's easier to visualize intermediate query results in my head when authoring a query. I guess it comes down to personal experience, some people write c# and can't stand VB.net and vice versa.

  • gary.strange-sqlconsumer

    SSCommitted

    Points: 1811

    Hi,

    Thanks for all your comments and feedback.

    I guess that DAX is still new and that not everyone is immediately aware of its existence. I will perhaps include more back ground information in any future articles.

    Regarding the language I feel that it is certainly not the easiest to learn and master. But when I come to re-visit my queries in 15 years times I'm sure I would have left plenty of useful comments like we all do, right? :doze:

    I certainly find it more palatable than MDX and it's easier to visualize intermediate query results in my head when authoring a query. I guess it comes down to personal experience, some people write c# and can't stand VB.net and vice versa.

  • Raunak Jhawar

    SSCoach

    Points: 15701

    Steve Jones - SSC Editor (9/25/2012)


    DAX is used in the SSAS world of Powerpivot

    http://msdn.microsoft.com/en-us/library/ff487170%28v=sql.105%29.aspx

    DAX is a new query language. It is proposed as an alternate(not to replace) to MDX.

    Raunak J

  • Mark Weinmann

    Valued Member

    Points: 52

    Nice article as a launching point for people just jumping into DAX.

    I do have a few questions, though..

    Under the Date & Time section, was the month portion of the DAX typo'd (says "year")?

    evaluate(

    ROW ( "First Year" , Year(Date(1900,1,1)),

    "First Month", Year(Date(1900,1,1)),

    "First Day", Day(Date(1900,1,1)) )

    )

    Also, the DAX directly below that one for some date arithmetic seems to be spelled incorrectly?

    evaluate(

    ROW ( "One month previous" ,eDate(now() ,-1) )

    )

    I don't have a DAX window open in front of me, but just some observations from reading the article. Again- great for beginners trying to correlate what they know with what they're trying to learn!

    Mark

  • gary.strange-sqlconsumer

    SSCommitted

    Points: 1811

    Thanks for the feedback Mark,

    I can look at my article a thousand times and not spot the typos. I just don't have an eye for it like others do.

    Thanks again,

    Gary

  • Mark Weinmann

    Valued Member

    Points: 52

    gary.strange-sqlconsumer (9/27/2012)


    Thanks for the feedback Mark,

    I can look at my article a thousand times and not spot the typos. I just don't have an eye for it like others do.

    Thanks again,

    Gary

    No problem. Looking forward to part 2 😉

  • Thinknook

    SSCrazy

    Points: 2531

    No problem. Looking forward to part 2 😉

    Me too, great article for DAX beginners, particularly since it directly compares SQL format to DAX.

    I would love to see some cross table based analysis in part 2 (stuff like select and aggregate values from another table based on the current value of column X for this table), if you are taking requests 😉

    />L

    -----------------
    ... Then again, I could be totally wrong! Check the answer.
    Check out posting guidelines here for faster more precise answers[/url].

    I believe in Codd
    ... and Thinknook is my Chamber of Understanding

  • Neha05

    Default port

    Points: 1494

    Nice article.

Viewing 15 posts - 1 through 15 (of 31 total)

You must be logged in to reply to this topic. Login to reply