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.
Let's say there is a single-select slicer with the following options from a column, 'Selection_Options'[Options]:
"Inbound"
"Outbound"
"Total"
In an accompanying line graph visual, depending on the slicer selection, a measure with a switch statement will be used to display a different measure.
Here is the accompanying measure used in the visual.
Solved! Go to Solution.
Hi @kpost ,
In DAX, variables () are evaluated once at the point they are defined in the formula. This means that all variables in your second are calculated regardless of the statement's outcome.
Given this, your assumption is correct. The first approach, where the measures and are calculated directly within the statement based on the slicer selection, is more efficient. This is because, in this scenario, only the measure corresponding to the selected option is calculated.
Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi @kpost ,
In DAX, variables () are evaluated once at the point they are defined in the formula. This means that all variables in your second are calculated regardless of the statement's outcome.
Given this, your assumption is correct. The first approach, where the measures and are calculated directly within the statement based on the slicer selection, is more efficient. This is because, in this scenario, only the measure corresponding to the selected option is calculated.
Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
85 | |
66 | |
51 | |
45 |
User | Count |
---|---|
216 | |
89 | |
82 | |
66 | |
57 |