What! We don't need to learn DAX anymore? (New Power BI Feature)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Dax is the most frustrating thing about power bi that is why I'm excited about this new feature we can now ask power bi what Dax we want and it will generate the code for us finally I can dump all my Dax books I can dump all my dump on with Xbox let's take a look at this feature to use this feature go to Power bi and load up any data here I have loaded a sample employee data set and then click on the quick measure feature this will open up the old quick measure screen by default so before you do this you need to go to the file options and settings options and go to the preview feature option and enable the quick measure suggestions box this feature is currently in preview mode but eventually this will become mainstream click OK and then restart the power bi and now we are able to access the quick measure feature when you tap on that this opens a tab here with either predefined calculations or the suggestions option I'm gonna go to the suggestions and let's take a look at our data this is employee data here with some employee IDs their FTE salary Etc let's ask a question like total FTE and when you click on generate this will calculate a total FTE measure using the simple sum formula so here you can see that the Dax power bi has generated is measure equal to sum of data table FTE column I'm going to add this measure I'm going to select this measure and rename this as total FTE next let's try asking a question of how many employees are there now a real world way of saying this is how many employees or how many staff are there but because of the way our data is structured it is in a table name data so we need to ask a question that is kind of suitable for our data model so I'm gonna just ask count of data and let's just try this this is just gonna do a count rows measure again nothing mysterious here if you are familiar with Dax the kind of measures that we are writing are fairly simple ones nothing complicated here but once you have some simple measures we can go and technically ask more complex questions to Dax I'm gonna rename this measure as head count both of these measures had count and total FTE are not that complex so let's take it up to the next level and ask a more complex question let's ask what is the female head count here we are not specifying where to find the word female and let's see what power bi does here it came up with a number I'm gonna add this so we can read the formula so this is what it says calculate data head count keep filters data gender is equal to female so this is pretty much how I would write the formula I would probably not use the word keep filters there unless I am doing something more specific on the UI so let's add this and now let's see what the female head count is as a percentage of overall head count so again I will use the natural language what is the percentage of female head count and here is the Dax it has generated I'm just gonna add this so we can see this whole thing here here we can see that it is actually using variables which is pretty awesome to begin with where filtered value is calculate data head count keep filters data gender is equal to female now this is a little bit of redundant because we already have a female head count measure I would have just reused that and then an overall head count and then divide one with another so the pattern is pretty much how I would normally write Dax but it's just that this feels a lot more variables let's go to the next level here I would like to make a report where I want to see for each department what is the difference between male versus female employees and then visualize that as a column or a bar chart so the question is difference between meal and female head count [Music] here I'm getting a number 520 that looks a little bit too high so I'm gonna add this and then we can read that measure so where Baseline value is calculate female head count where gender is equal to male now we know for a fact that that is actually a rubbish way of doing it because I think it's not reading this correctly so it's saying male and female head count rather than thinking of these as two separate words and then calculate the female head count itself and then doing the difference so the correct wording here or correct measure here would be just do a head count rather than female head count so yeah that's a problem with these kind of quick measures or any artificial intelligence based code generation practices especially if you are learning then we don't even realize that the AI has made a mistake because we have no other reference points to verify what is the right way of doing it so I would be quite cautious around this particular feature let's see what else it can do let's try one more example what is the Imp ID of top salary it says 119 754.81 so it's actually giving me the top salary not the ID and it is using a summarize and uh and top end to calculate all of this but I feel like it's actually giving me the measure value which is the wrong one we are asking for employee ID not the salary itself so this is a completely wrong result altogether and even the intent is not properly captured so yeah again a round answer from our measure suggestion option [Music] well I'm not throwing away my Dax books while the quick measure feature is interesting it is nowhere near perfect we can of course use it to make some simple measures or write the code which we can later modify and that brings us to the topic of learning Dax if you want to learn how to use Dax and power keyword check out this video it has quite an in-depth explanation of how Dax really works along with 20 plus examples I'll catch you there bye [Music]
Info
Channel: Chandoo
Views: 201,413
Rating: undefined out of 5
Keywords: chandoo, chandoo.org, dax, power pivot, how to learn dax, how to master dax, no code dax, ai dax, quick measures, power bi, data analysis expressions, power bi dax, power bi tutorial, power bi dax tutorial, dax functions
Id: mPCDJag-6Zg
Channel Id: undefined
Length: 7min 27sec (447 seconds)
Published: Tue Jan 17 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.