Forum Discussion

jvandyck's avatar
jvandyck
Helper IV
5 years ago

Dax question

Hi 

 

I have a data table with region, date, bank balance and advance payment.

I have to compare the bank balance against a target. The target is the full year sum of the advance payments of the previous year, divided by 12 by 100.

This is the formula: 

Target month bank balance = calculate(SUM('Monthly Surplus'[Advance Payment]), previousyear('Date'[Date]))/12/100
 
I want to create a table showing year and the number of times the bank balance exceeded the target. I have tried this formula, but it does not seem to work:
Exceeded summarize = COUNTAX
(
SUMMARIZE('Monthly Surplus','Date'[Year],'Date'[Month],'Monthly Surplus'[Regio],"Bank Balance",sum('Monthly Surplus'[Bank Balance]),"target",calculate([Target month bank balance])),if(not isblank([Bank Balance]),[Bank Balance]>[target]))
 
In this last formula, it seems that the target is nog calculating and therefore counting every month.

1 Reply