March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
This is a five-question quiz on DAX.
Can you answer all five questions correctly? 🙂
Enjoy!
Daniil Maslyuk
eyJrIjoiMzc5OWMyMDYtNGE3MS00OWUzLTgzZjEtN2FlZDcyOGQyZTQwIiwidCI6ImQzMmNkYzNmLTY1NTUtNGNhYy1iYjFhLTg2OWZiMTE0MzRlNSJ9
Excellent use of Power BI to confirm my suspicion that I need to work on my DAX skills. The one on variables was VERY interesting and I totally got it right. Totally.
Hi, It is a great app. Could you share your pbix file to me (iacentre@gmail.com)? Thanks
I really liked this dashboard, I haven't met any tests in power bi yet
Hi Daniil,
came across your report. Besides you just schattered my confidence that I was on a good way to understand a bit of DAX, the quiz is great. I understand that you intentionally built the example, but it can happen in the real world as well -> https://sqlkover.com/sumx-returns-incorrect-results-with-duplicates/
Unfortunately I do not understand all your explanations (yet) and Alberto's posts made my head even more spinning. I am very confused, as a beginner we use COUNTROWS and SUMX a lot and we are proud of ourselves, that we finally get some nice visuals out of it. Now it seems we cannot trust even the simplest calculation without doublechecking the results in Excel (which brings us back to 1987). Then what's the point of having DAX, if SUMX returns 7 (question 3) in a data set of 1,3,1 (which ... for me ... totals still 5, unless the earth spinns the other way around); I tripplechecked on my old fashion calculator and it says 1+3+1=5, I intend to believe that.
Ok, stop whining ... here are my questions:
For comparison reasons and following the tip from Koen, I built your example with an index column, which solved most, but not all problems (-> VAR).
I learned, that the "DAX onion" is eaten from the inside out, meaning complex DAX is executed from inside to outside.
From that understanding the result should be blank.
First the "inside" CALCULATE returns a distinct list of values (colors) which is then filtered down to only "Black".
Then the "outside" CALCULATE shall return "White". But as there is no "White" after step 1, it shall return Blank.
What's wrong with that (my) thinking?
I read a lot about strange behavior of VAR and wrong results. VAR is a wonderful tool to structure DAX code, but how can I make sure, that the result does not come out rubbish?
Many thanks in advance
This is a witty power BI report and it lost my confidence in DAX 😥
@datadonuts, thanks for the comment! DAX does require the understanding of theory indeed 🙂
On Q2: Context is considered from the outside to inside. On the outside, we've got White. Then inside, we've got Black, which overrides White, because column filters have ALL in them. I.e. White is ignored, then Black is set.
On Q4 (you probably meant Q4 not Q5 because Q5 has no VAR): this question was leveraging the fact that variables can't be re-evaluated under a different context. They're evaluated only once, then they become constants. Hence no matter what filters you apply to a variable that's been evaluated already, the results won't change -- just like if you tried CALCULATE(5, ...
This is great - thanks!
Hi Daniil,
Nice Dashboard!
How Do you hide the bar that is underneath that shows the page number?
@Anonymous, thank you! There is only one page, so the bar is not visible. I don't think you can hide the bar when there is more than one page.
@ngadiez, there is a set of hidden slicers to keep track of scores. I'm writing a blog post that explains this technique in more detail.
Hi @Daniil
May I know how did you calculate number of correct or wrong like this? How to keep track?
I know it's a dumb question, but how do you hide that bar underneath that shows the number and name of the pages?
@hohlick, thank you, Maxim 🙂
@MFelix, are you referring to "How well do you know the Simpsons"? I think they used a custom visual to achieve the effect of "saving" answers. In my report, I am not using any custom visuals -- only the built-in features of Power BI Desktop. I used the latest enhancements to the bookmarking feature, which allow you to modify only selected visuals and not the entire page. I might write a blog post on it to explain better 🙂
Hi @Daniil,
Great dashboard !
Just one question that I have already seen in another dashboard but was not abble to get it.
How do you achieve to "save" the answers in order to have the final graph?
Thank you.
Regards,
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsThis is probably basic but as a newbie I must ask how do you create buttons that allows you to navigate through pages.
In this case, th answer button.
That is achieved by bookmarks. So you basically create an image as a button by linking it to a preset bookmark.
Oh I see, Thanks a lot for your input!
This is brilliant. Having the DAX formulae on the answer page would have been helpful!
@Anonymous, thanks for your feedback! DAX formulas should now be visible in answers 🙂
@Rod, @prateekraina gave the correct answer to your question 🙂