Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
madhavan2427
Frequent 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 3
Greg_Deckler
Community Champion
Community 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


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hello @Greg_Deckler ,
values i am getting by using this its not appropritate and timing is almost same.

But thankyou for reply.

@madhavan2427 Would really need to work with the dataset to optimize it, otherwise it is just shooting in the dark.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.