Forum Discussion
Sonne
7 years agoHelper II
time consuming calculation
I have a measure which takes a lot of time to calculate and the value in matrix is not really coming up. It works , but if people have to wait 5 min to see the values they are not happy. maybe some...
Sonne
7 years agoHelper II
Hm ok I understand. if i take now your formular:
previous Period = VAR a = CALCULATE ( 'DPA '[DPA N-3]; Period[Period] = "P0" & MONTH ( TODAY () ) - 2 ) VAR b = CALCULATE ( 'DPA '[DPA N-3]; Period[Period] = "P0" & MONTH ( TODAY () ) - 1 ) RETURN IF ( ( ( a ) + 0,005 ) <= ( b ); ROUND ( ( a * 100 ); 1 ) & " % " & " " & UNICHAR ( 129093 ); IF ( ( ( a ) - 0,005 ) > ( b ); ( ROUND ( ( a * 100 ); 1 ) ) & " % " & " " & UNICHAR ( 129095 ); ( ROUND ( ( a * 100 ); 1 ) ) & " % " & " " & UNICHAR ( 129094 ) ) )
I have here var a and var b . Can I use this variables in the other measures where i also use this caluclation.
in this formular for excample:
ColorKPI1 = switch(true();
(CALCULATE('DPA '[DPA N-3];Period[Period]="P0"&MONTH(TODAY())-2))+0,005<=(CALCULATE('DPA '[DPA N-3];Period[Period]="P0"&MONTH(TODAY())-1));"#198c19";
(CALCULATE('DPA '[DPA N-3];Period[Period]="P0"&MONTH(TODAY())-2))-0,005 > CALCULATE('DPA '[DPA N-3];Period[Period]="P0"&MONTH(TODAY())-1);"#b20000";"#b2ac00")
v-lili6-msft
7 years agoCommunity Support
hi, Sonne
For each measure, the variables are Independent.
So for [ColorKPI1], if you want to use variables, you need to define it again.
https://docs.microsoft.com/en-us/dax/var-dax
Best Regards,
Lin