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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Shafi293
Frequent Visitor

How to optimize below DAX

Hi guys can u plz help me out with the  below query ,it takes around more than 50sec to show results 
w1 =
CALCULATE([SettlementAmountm],
Filter(Fact_Revenue_management,
if(ISBLANK(Fact_Revenue_management[BankTransactionDate].[Date] ), MAX(DimDate[Date]), Fact_Revenue_management[BankTransactionDate].[Date]) <= Fact_Revenue_management[PaymentDueDate].[Date]
&&
 Fact_Revenue_management
[ReconFlagForBank] = BLANK() || max(DimDate[Date]) < Fact_Revenue_management[BankTransactionDate].[Date]
&&
Fact_Revenue_management[DimPaymentGatewayID]<>21 && Fact_Revenue_management[DimPaymentGatewayID]<>14 ))

+
CALCULATE([Paypal Outstanding],Filter((Fact_Revenue_management),
if(ISBLANK(Fact_Revenue_management[BankTransactionDate].[Date] ), MAX(DimDate[Date]), Fact_Revenue_management[BankTransactionDate].[Date]) <= Fact_Revenue_management[PaymentDueDate].[Date] && ( Fact_Revenue_management
[ReconFlagForBank] = BLANK() || max(DimDate[Date]) < Fact_Revenue_management[BankTransactionDate].[Date]) && Fact_Revenue_management[DimPaymentGatewayID]=14 ))

other measures used are 
SettlementAmountm =
Calculate(Sum(Fact_Revenue_management[SettlementAmount]),Fact_Revenue_management[DimPaymentGatewayID] <>14,FIlter(DimPaymentGateway,DimPaymentGateway[TFPaymentID]="True" && DimPaymentGateway[DimPaymentGatewayID] <>21 && DimPaymentGateway[DimPaymentGatewayID] <>14))
+
[Paypal settlement]
+
Calculate(Sum(Fact_Revenue_management[SettlementAmount]),FIlter(DimPaymentGateway,DimPaymentGateway[TFPaymentID]="False" ))
+CALCULATE(Sum(Roku[TransactionAmount]),Filter(DimPaymentGateway,DimPaymentGateway[DimPaymentGatewayID]=21))

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @Shafi293,

 

Please refer to this video.

https://sqlbits.com/Sessions/Event12/Optimizing_Analyzing_DAX_Query_Plans

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

3 REPLIES 3
v-frfei-msft
Community Support
Community Support

Hi @Shafi293,

 

Please refer to this video.

https://sqlbits.com/Sessions/Event12/Optimizing_Analyzing_DAX_Query_Plans

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
luxpbi
Helper V
Helper V

Can you please share some sample data ?

 

Thank you

Thanx for your time guys ,ill try to privide sample data for better understanding .

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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