Forum Discussion

Julia2023's avatar
Julia2023
Helper I
1 year ago
Solved

Measure Improvement

Hi Community,

Any ideas on how to adjust this step to improve model performance? Loading results is quite slow right now.

 

Classification =

IF(

    [Sales Ranking] > 0.8,

    "First",

    "Second"

)

  • Anonymous's avatar
    Anonymous
    1 year ago

    Thanks for the reply from Kedar_Pande , Kedar_Pande  and lbendlin , please allow me to provide another insight:

    Hi, Julia2023 

    You might also consider adding the following custom column in Power Query:

    if [Column1]>=0.8 then "First" else "Second"

    Power Query loads data into memory when processing, optimising memory usage and reducing memory pressure during subsequent calculations.

     

    Of course, you can also perform performance optimisation checks in the following location within the desktop application:

     

    For further details, please refer to:

    Use Performance Analyzer to examine report element performance in Power BI Desktop - Power BI | Microsoft Learn

    Please find the attached pbix relevant to the case.

     
    Of course, if you have any new discoveries or questions, please feel free to get in touch with us.
     

    Best Regards,

    Leroy Lu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

5 Replies

  • Raghava_1998's avatar
    Raghava_1998
    Frequent Visitor

    Hi Julia2023 
    Can you please try this one.
    Classification =
    var SalesRank = [Sales Ranking]
    return
    IF(SalesRank > 0.8, "First", "Second")
    Thanks

  • Use DAX Studio to evaluate the situation and identify the actual culprit (which may be hidden somewhere in your  nested measures).

  • Julia2023 
    Use Calculated Columns Instead of Measures

    Classification = 
    IF(
    [Sales Ranking] > 0.8,
    "First",
    "Second"
    )


    If [Sales Ranking] is based on complex calculations, move those calculations to Power Query or as a calculated column in your data model, if possible, so they don’t get recalculated repeatedly when interacting with the model.

    💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
    Cheers,
    Kedar
    Connect on LinkedIn

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thanks for the reply from Kedar_Pande , Kedar_Pande  and lbendlin , please allow me to provide another insight:

    Hi, Julia2023 

    You might also consider adding the following custom column in Power Query:

    if [Column1]>=0.8 then "First" else "Second"

    Power Query loads data into memory when processing, optimising memory usage and reducing memory pressure during subsequent calculations.

     

    Of course, you can also perform performance optimisation checks in the following location within the desktop application:

     

    For further details, please refer to:

    Use Performance Analyzer to examine report element performance in Power BI Desktop - Power BI | Microsoft Learn

    Please find the attached pbix relevant to the case.

     
    Of course, if you have any new discoveries or questions, please feel free to get in touch with us.
     

    Best Regards,

    Leroy Lu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • To improve performance for this calculation, you can use a calculated column instead of a measure if [Sales Ranking] doesn’t change frequently. Calculated columns are evaluated once when the data is loaded, while measures are recalculated every time you interact with visuals, which can slow down performance.

     

    Here's how you could create it as a calculated column to improve efficiency:

     

    In your table, create a new calculated column with the following formula:

     

    Classification =

    IF('YourTable'[Sales Ranking] > 0.8, "First", "Second")

    Replace 'YourTable' with the name of the table containing [Sales Ranking].

     

    Additional Tips for Model Performance

    Check Data Granularity: If your dataset is very large, try aggregating or summarizing it to reduce the number of rows loaded.

    Optimize Data Types: Ensure [Sales Ranking] is of the most efficient data type (e.g., Decimal rather than Text if possible).

    Using a calculated column for static classification like this will reduce the need to repeatedly evaluate it in each visual, which can help improve report performance.

     

    Let me know if you need more ideas!