Forum Discussion

PowerWhy's avatar
PowerWhy
Helper IV
3 years ago
Solved

Slow Measure

Hello,   Please can someone suggest why the below measure may be hanging? It is in a 'table' visualisation. The first two columns of the table are Employee Name and Customer Name (from dimension ta...
  • Mikelytics's avatar
    Mikelytics
    3 years ago

    Hi PowerWhy 

     

    to your first question: It runs faster because in your formula you execute two times the same calcultion with 

    [CY YTD Revenue]

     

    your formula acts like this 

    IF [CY YTD Revenue] is not zero -> the value is calculated and Power BI checks if the value is zero or not

    THEN [CY YTD Revenue] -> Power Query executes the calculation again

     

    my formula acts like this

    the variable calculates the result of [CY YTD Revenue] -> so Power BI knows the result of [CY YTD Revenue] and "keeps it in mind"

    then it does the following:

    IF check whether results of variable is zero or not -> Power BI already knows the result so no need to calculate again

    THEN results of variable -> Power BI still ahs in mind the result of [CY YTD Revenue] -> so no other calculation

     

    ouy see.. in your version it calculates the same formula two times and in my formula it calculated only once the formula.

     

    regarding your seconfd question I do not understand what you mean to be honest.

     

    Can you please mark thread as solved to help me as well as to help others findin the post when they have the same problem. I also appreciate your thumbs up. 🙂

     

    Best regards

    Michael

    -----------------------------------------------------

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

    @ me in replies or I'll lose your thread.

    -----------------------------------------------------

    LinkedIn