Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I've created following DAX calculated column with help of variable. I've tried to do the same without variables, but for me using variable is much more simpler.
Besides is it possible to rewrite following query without variables (I don't need actual query, just yes or no, and which functions should I use)?
CountByMonth = var current_date = 'questions'[Creation Date Dim] var total = SUMX(FILTER('questions','questions'[Creation Date Dim]=current_date), 'questions'[Count]) return 'questions'[Count] / total
Are there any performance implications, if I'm using variables instead of direct query?
Solved! Go to Solution.
@Anonymous
Yes you can rewrite without variables.
There is a method using CALCULATE and ALLEXCEPT, and another method using FILTER and EARLIER.
In general variables avoid repeated evaluation of an expression, but not sure how much that might impact performance in this case - others may have an idea.
hey ,
Var plays the main important role in DAX. It is Super Hero of Dax. It will cant give performance issue comapre with anyother DAX Functions like Earlier etc ..
I stongly suggest use VAR
hey ,
Var plays the main important role in DAX. It is Super Hero of Dax. It will cant give performance issue comapre with anyother DAX Functions like Earlier etc ..
I stongly suggest use VAR
@Anonymous
Yes you can rewrite without variables.
There is a method using CALCULATE and ALLEXCEPT, and another method using FILTER and EARLIER.
In general variables avoid repeated evaluation of an expression, but not sure how much that might impact performance in this case - others may have an idea.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
106 | |
75 | |
44 | |
39 | |
33 |
User | Count |
---|---|
165 | |
90 | |
65 | |
46 | |
43 |