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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Phoenix12
Frequent Visitor

Convert Excel formula to DAX

Hello,

Can someone please assist with converting this excel formula to DAX

 

SUMIFS('dispute log'!$K:$K,'dispute log'!$AL:$AL,">"&$A17,'dispute log'!$AK:$AK,"<="&$A17)+SUMIFS('dispute log'!$K:$K,'dispute log'!$AL:$AL,"---",'dispute log'!$AK:$AK,"<="&$A17)

 

Spelt out: 

=SUMIFS(Dispute_Log[dispute_amt],Dispute_Log[Close Period]>MONTH, Dispute_Log[Open  Period]<=MONTH)+ SUMIFS(Dispute_Log[dispute_amt],Dispute_Log[Close Period] IS BLANK > MONTH,  Dispute_Log[Open  Period]<= MONTH)

 

1 ACCEPTED SOLUTION
jst_jdennis
Frequent Visitor

You can use the following DAX formula to replicate the functionality of your Excel formula:

 

 

= 
VAR Month = MAX(Dispute_Log[Month])
RETURN
CALCULATE(
    SUM(Dispute_Log[dispute_amt]),
    Dispute_Log[Close Period] > Month,
    Dispute_Log[Open Period] <= Month
) + CALCULATE(
    SUM(Dispute_Log[dispute_amt]),
    Dispute_Log[Close Period] = BLANK(),
    Dispute_Log[Open Period] <= Month
)

 

 

Make sure to replace the table and column names as necessary. This formula first finds the maximum month value in the Dispute_Log table and assigns it to a variable. Then, it uses the CALCULATE function to calculate the sum of dispute_amt where the Close Period column is greater than the maximum month value and the Open Period column is less than or equal to the maximum month value. The formula then adds to this sum the sum of dispute_amt where the Close Period column is blank and the Open Period column is less than or equal to the maximum month value.

 

Credit: ChatGPT | https://chat.openai.com/chat

*I did not answer your question, the AI chatbot ChatGPT gave this answer*

View solution in original post

1 REPLY 1
jst_jdennis
Frequent Visitor

You can use the following DAX formula to replicate the functionality of your Excel formula:

 

 

= 
VAR Month = MAX(Dispute_Log[Month])
RETURN
CALCULATE(
    SUM(Dispute_Log[dispute_amt]),
    Dispute_Log[Close Period] > Month,
    Dispute_Log[Open Period] <= Month
) + CALCULATE(
    SUM(Dispute_Log[dispute_amt]),
    Dispute_Log[Close Period] = BLANK(),
    Dispute_Log[Open Period] <= Month
)

 

 

Make sure to replace the table and column names as necessary. This formula first finds the maximum month value in the Dispute_Log table and assigns it to a variable. Then, it uses the CALCULATE function to calculate the sum of dispute_amt where the Close Period column is greater than the maximum month value and the Open Period column is less than or equal to the maximum month value. The formula then adds to this sum the sum of dispute_amt where the Close Period column is blank and the Open Period column is less than or equal to the maximum month value.

 

Credit: ChatGPT | https://chat.openai.com/chat

*I did not answer your question, the AI chatbot ChatGPT gave this answer*

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors