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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Srikantht
Helper II
Helper II

Optimize my dax query

Hi,

 

Can anyone optimize the below query. it's taking 15 seconds to load when I run in Dax studio. and this measure I am using for conditional formatting. 

CAGR = Var matrix1 =  CAGR (% TY v LLY)]
Var matrix2 =
    CALCULATE(CAGR (% TY v LLY)],
    ALL('STATES')
    , ALL('STORES')
, ALL('PRODUCT')
    )
Return
IF(matrix1 > matrix2, "GREEN", "RED")

 

Thanks in advance. 

 

 

5 REPLIES 5
Ahmedx
Super User
Super User

Didn't understand! has your question been optimized or not?

Hi 

 

Anyone have idea to optimize this measure?

 

and also I 've created this measure in report level. and data is coming from SSAS model. if i create same measue in ssas model and deploy then add to report. will it be optimse? becuase this measure comes from then SSAS model. 

 

 

anyone help me in this?

 

Thanks. 

@Ahmedx 

 

your measure not worked it gives "RED" for every category. 

 

my question in your measure, why you did not take three tables? 

Ahmedx
Super User
Super User

CAGR = Var matrix1 =  CAGR (% TY v LLY)]
Var matrix2 =
    CALCULATE(CAGR (% TY v LLY)],
REMOVEFILTERS()
    )
Return
SWITCH( TRUE,matrix1 > matrix2, "GREEN", "RED")

Hi @Ahmedx 

 

Thank you for your quick response.

 

In the above you dax why you did not consider three tables of states, stores and product. ?

will removefilters appply to 3 tables whitout metioning in formaula. ?

 

Thanks

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

Find out what's new and trending in the Fabric community.