I’m trying to add two measures to my report that will give me the following:
1. An actual to budget variance column. The only trick is that it needs to evaluate the account type and if it is a Revenue account, it needs to do Actual minus Budget, but if it is a Cost or Days accounts it needs to do Budget minus Actual. This is the formula I’ve come up with but DAX is not accepting it (AccountType Code 2 is for Revenue):
=IF(COUNTROWS(VALUES( AccountTypes[AccountType])=1,
IF(VALUES( AccountTypes
1. An actual to budget variance column. The only trick is that it needs to evaluate the account type and if it is a Revenue account, it needs to do Actual minus Budget, but if it is a Cost or Days accounts it needs to do Budget minus Actual. This is the formula I’ve come up with but DAX is not accepting it (AccountType Code 2 is for Revenue):
=IF(COUNTROWS(VALUES( AccountTypes[AccountType])=1,
IF(VALUES( AccountTypes
Code:
)=2 ,
sum(Actual[Amount])-Sum(Budget[Amount]) ,
sum(Budget[Amount])-Sum(Actual[Amount]) ),
0))
2. A per day ratio for each line item. This is the formula I’ve come up with but, again, DAX is not accepting it (AccountType Code 1 is for Days):
=IF(COUNTROWS(VALUES(
AccountTypes[AccountType])=1,
(sum(Actual[Amount]/sum(Actual[Amount],AccountTypes[Code]=1)
),0))
I know I am close but I’m missing something. Can someone give me a hint as to what I’m doing wrong? Thanks a lot.