Welcome back to another edition of our Tech Interview series! Whether you are going on an interview for a Power BI role or you’re the one conducting the interview we’ll cover questions, best answers and discuss key points to get you prepared. This edition focuses on DAX questions you may ask or be asked in an interview.
We’ll start with some basic DAX questions and move to a few more advanced concepts. Be sure to watch the included video for demos of what we discuss.
1. What is DAX?
Answer: DAX stands for Data Analysis Expression language. DAX is the ability to extend your data by using calculations and aggregating it. It works on functions, operators and constants and it pulls it together to further extend your model. Let’s say you wanted to calculate year to date sales or compare profit year over year, any point of complexity is a great use case for DAX to aggregate and pull things together.
KEY POINTS:
2. In our last episode on Data Shaping interview questions, we talked about the Query Editor and using Power Query to build on what we have, and one thing we can do is add a new column. When would I decide whether to do something in the Power Query Editor vs DAX to create a column?
Answer: It depends on what you want to do. You want to use the right tool for the job so if you’re focusing on transformation things that are done upstream, like ETL work, you’ll want to use the Power Query Editor to benefit from adding a column as a transformative element.
You’d want to use DAX for calculations, analytics, aggregation work a bit further downstream. (For a demo in the desktop where you would use a DAX column vs a Power Query column, be sure to take a look at the video.)
KEY POINTS:
3. Why would I choose calculated columns vs calculated measures inside of Power BI?
Answer: A calculated measure is a higher-level DAX measure that’s used over the entire model. A calculated column is focused row by row. Let me show you:
KEY POINTS:
4. The next question is regarding time intelligence in DAX. In DAX we can do year to date and parallel period and such, which is great for financial reporting. What are some prerequisites for doing time intelligence?
Answer: The main prerequisite is you need a date table, more specifically, a continuous date table with a whole range of dates (no breaks in the dates). That way you can calculate over that continuous line. You can build that date table using the M language in the Power Query Editor, use DAX or if you already have one in your model or data source you can bring it into Power BI.
The second element you need is to define the relationship with the date table and the other appropriate tables.
Remember all dates should be present without exception and you need a proper relationship for time intelligence to function the way you intend it to.
5. What is filter context and how does it impact the way I work with my data?
Answer: Filter context is important because it affects everything. It is all the influencing filters that will affect how your data displays itself; at the visual level, report level, relationships and DAX calculations impact the filter context, basically anything that filters and slices up your data and how you’ll see it. Let’s see how this works:
KEY POINTS:
That wraps us this edition of Interview Questions for DAX; we hope you found it helpful in preparing to impress on an interview for a DAX position or if you’re the one asking the questions of a candidate.
Please let us know in the comments below if you have any questions you’d like to see answered or for future topic for us to cover in our Interview series. If you’re looking for training to prepare you for a new role or step in your career, our On-Demand Learning platform has 15+ Power BI courses as part of over 50 deep dive courses covering Azure, Analytics, SQL Server and much more, that will give you the training you need. Get started today with our FREE Dashboard in a Day course with 7+ hours of Power BI content— just click the link below!