Forum Discussion
Slow Measure
- 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.
-----------------------------------------------------
Thank you Mikelytics the first formula worked perfectly 🙂
Please do you know why your formula is so much faster (almost instant) rather than about 50% faster? (given it's replacing 2 parts of a formua with 1?)
Also when I was testing I tried a formula that just returns "1", but this was also hanging - please do you know why that would be?
- Mikelytics3 years agoResident Rockstar
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.
-----------------------------------------------------