- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Most effecient way to include a IF statement in measure, Best Practise
Hi Guru's
I have many variables that need to be created and they are mostly always relying an if statement.
My reports performance is slowing down drastically.
What is the best practice to optimize performance when using this type of formula?
Should I create a Measure or better to create a Calculated Column?
Should I use SUMX? or is there a performance optimizing alternative?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello @Anno2019
In your example it doesn't look like you need to use SUMX. Instead start with a base measure that sums your price
Price Amount = SUM ( 'Data'[Price] )
Then you use that in measures that apply the filtering you need
Value Actual =
CALCULATE (
[Price Amount],
KEEPFILTERS ( 'Data'[Value Category] = "Included in Pricing Model" )
)
SUMX is an iterator which can be expensive if you use it when you don't need to.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello @Anno2019
In your example it doesn't look like you need to use SUMX. Instead start with a base measure that sums your price
Price Amount = SUM ( 'Data'[Price] )
Then you use that in measures that apply the filtering you need
Value Actual =
CALCULATE (
[Price Amount],
KEEPFILTERS ( 'Data'[Value Category] = "Included in Pricing Model" )
)
SUMX is an iterator which can be expensive if you use it when you don't need to.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@jdbuchanan71 This sounds great, will most certainly try this. I have base measures for all my measures so will be easy to apply.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In my Opinion always creating a measure is best instead of creating additional column in the Data
First Create a measure with SUMX or SUM based on the data and then filter that with other parameters in another measure.
If you have some data sample I can help further
Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis
Proud to be a Super User!

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
04-16-2024 11:18 AM | |||
04-03-2024 03:02 AM | |||
06-20-2024 04:58 AM | |||
09-17-2024 09:04 PM | |||
03-04-2024 09:49 AM |
User | Count |
---|---|
83 | |
80 | |
47 | |
37 | |
37 |