Interview Questions — DAX in Power BI — Part 2

It’s a continuation of possible interview questions and answers about DAX in Power BI based on my experience and understanding.


In the previous blog, we learn 12 interview questions and answers on DAX. 

Now in this blog, we will get into a deeper level of questions. 

Please remember, only questions and answers can’t help you to clear any interview, you have to practice each and every syntax. Otherwise, it will be very difficult for you to explain any example using DAX.


Question 13: Tell me about the context concept in DAX. How many types of contexts are there?

In DAX, context is the layer of filtering and is applied to calculations to produce a result related to every value of a visual or pivot table including rows and columns totals.

By definition, context is an important concept for building high-performing, dynamic analyses and for troubleshooting problems in formulas.

Question 14: How many types of contexts are there?

There are 3 types of contexts.

  1. Filter Context
  2. Row Context
  3. Query Context

Question 15: What do you mean by Filter context in DAX? How many types of filter contexts are there? 

When we are applying filters on the set of values of columns or tables using DAX calculations, that is known as Filter Context. 

There are two types, implicit and explicit filter context.

Question 16: How does Filter context work in a DAX expression?

Before executing the core expression, the filter context will finalize. Once it is decided, filter rules (inside context) are applied across the data and calculations execute on the remaining data. 

Question 17: In a DAX expression, which one will execute first Filter context or Row Context? 

Filter context applies on top of other contexts, such as row context or query context.

Question 18: Difference between implicit and explicit filter contexts. 

When in the DAX calculation, you have not declared filters explicitly, so the value will be different based on any dimension field selection. This is the effect of the DAX implicit filter context. 

Explicit filter context means in calculations where specifically adds or removes column filter rules to and from the filter context.

Question 19: What do you mean by Row Context?

Row Context is related to current rows. If you create a calculation using the calculated column, the row context involves the values of all columns from the current row. If that table has a relationship with the other table, then it includes all the related values from the other table for that row.

Question 20: What is Query Context?

The combination of row and filters create the final query for DAX. You can define this is as query context. Users explicitly mention row and filter context for DAX, and DAX implicitly creates the query context from that filter and row context.

Please practice with some examples before attending an interview. If you need some help to understand this concept with examples, please refer to my blog.

https://arpitatechcorner.com/2021/04/25/context-in-dax-power-bi/

Question 21: Will DAX relationships work for many to many relationships? 

No, DAX relationships work only for the one to one and one to many relationships.

Self-joins that means a table joins back with itself, cannot be possible.

Question 22: For the DAX relationship, can you work with the composite key? 

No, in this situation where multiple columns are responsible for data uniqueness, we need to create a new column with the combination of multiple columns and use it for relationships.

Question 23: How DAX will work without a standard relationship? or 

How will you join two tables without any standard relationship between them?

We can use different DAX functions to solve this problem.

CROSSJOIN → More than two tables can be joined. The final output will have cartesian effects

GENERATE → Only Two tables. If you want to add FILTER, then it is the better option.

NATURALINNERJOIN and NATURALLEFTOUTERJOIN → These will behave like inner join, left outer join.

Union, Except, and Intersect → These functions help to merge or combine tables.

Please practice with some examples before attending an interview. If you need some help to understand this concept with examples, please refer to my blog.

https://arpitatechcorner.com/2021/04/30/joins-dax-power-bi/

Conclusion

In this blog, we get some idea about more interview questions on DAX mainly context and relationships. We will know more DAX interview questions in the next blog.

If you have any questions related to this project, please feel free to post your comments.

Please like, comment and subscribe to my YouTube channel which you have already seen. 🙂 Keep Learning.

1 comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: