Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have been trying to learn more about Optimising Dax using a data sample from sqlbi (DAX Optimizations Examples with Alberto Ferrari) Orders Table has 1.6 million rows of data. I have two identical measures except one does not use variables. The measure with variables takes 14 seconds to execute and the other 0.5 seconds. I am unsure why variables are having an impact on performance.
Measure 1
To be able to answer the question one has to see the execution plans for both queries. There is no other way.
However, some things to observe:
1. The two measures (they are not queries!) are not logically equivalent.
2. The second one removes all filters from 'Date' BEFORE calculating the number of rows, so the logical expressions in filter can be totally ignored (in the presence of the assumed relationship). This is not the case in the first query when you first calculate the bounds and then use the bounds in the expression. These bounds stay put despite the ALL directive.
did really these querys return the same result?
Yes identical results just different execution times
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
9 | |
8 | |
6 | |
5 |
User | Count |
---|---|
19 | |
17 | |
12 | |
9 | |
9 |