Forum Discussion
madhavan2427
4 years agoFrequent Visitor
Dax(Measure) Otimization
Hello All,
Please look into the measures and guide me to optimize it. These are taking so much time to load(process).
Please suggest, if can we make a calculated table instead of the measure.
1.
A_TCPU =
var _C= CALCULATE(SELECTEDVALUE('Aggregated by VM'[CPU])) * ((100-[CPU_Rightizing_% Value])/100)
Return
IF(SELECTEDVALUE('Aggregated by VM'[Max CPU])>0 && SELECTEDVALUE('Aggregated by VM'[Max CPU])<[CPU_Max_Utilization Threshold Value],_C,SELECTEDVALUE('Aggregated by VM'[CPU]))
+++
2.
m_cpumatch =
var _cpu ='Aggregated by VM'[A_TCPU]
var tableFiltered=
TOPN(1,CALCULATETABLE('Price List',Filter('Price List','Price List'[CORE]>=_cpu && 'Price List'[Supported]="YES" &&'Price List'[Location] ='Aggregated by VM'[Location] ) ),'Price List'[CORE],ASC)
Return
SUMX(tableFiltered,[CORE])/COUNTX(tableFiltered,[CORE])
Thankyou!
3 Replies
- Greg_DecklerCommunity Champion
madhavan2427 Try:
A_TCPU = VAR __Value = SELECTEDVALUE('Aggregated by VM'[CPU]) VAR __C = __Value * (100-[CPU_Rightizing_% Value])/100 Return IF(__Value >0 && __Value <[CPU_Max_Utilization Threshold Value],_C,__Value) m_cpumatch = var _cpu ='Aggregated by VM'[A_TCPU] var _min = MINX( CALCULATETABLE('Price List',Filter('Price List','Price List'[CORE]>=_cpu && 'Price List'[Supported]="YES" &&'Price List'[Location] ='Aggregated by VM'[Location] ) ), 'Price List'[CORE] ) Return __min- madhavan2427Frequent Visitor
Hello Greg_Deckler ,
values i am getting by using this its not appropritate and timing is almost same.
But thankyou for reply.- Greg_DecklerCommunity Champion
madhavan2427 Would really need to work with the dataset to optimize it, otherwise it is just shooting in the dark.