jorgemaiden
New Member
- Joined
- Mar 18, 2012
- Messages
- 2
Hello,
I'm relatively new to Power BI. I'm stuck with a formula for some time now so any help would be appreciated.
I need the running total (YTM) for the ammount balance, depending on the year and month selected on the slicers.
The model (simplified) is as following
I'm using two measures:
The error I'm getting occurs when I select a month that doesn't have any value to a specific ID_COST_CENTER / ID_ACCOUNT, as in the example below - in green what I expect to see in a card depending on the year/month selected and in red what I'm getting with the formula I'm using.
As you can see, when I select May, I'm getting a zero instead of 4306. In May the pair ID_COST_CENTER a / ID_ACCOUNT 123 doesn't exist, but I need to show the total for the year.
How can I change the formula to obtain the desired results?
Thanks for your help.
Jorge
I'm relatively new to Power BI. I'm stuck with a formula for some time now so any help would be appreciated.
I need the running total (YTM) for the ammount balance, depending on the year and month selected on the slicers.
The model (simplified) is as following
I'm using two measures:
Excel Formula:
[Accumulated Balance] = SUM(PROFIT_CENTER[AMT_BALANCE])+0
Excel Formula:
AMT_BALANCE_YTD =
VAR YEAR = SELECTEDVALUE(PROFIT_CENTER[YEAR])
VAR MONTH = SELECTEDVALUE(PROFIT_CENTER[MONTH])
return
CALCULATE([Accumulated Balance];
FILTER(ALLEXCEPT(PROFIT_CENTER;DIM_STRUCTURE);PROFIT_CENTER[YEAR] = YEAR && PROFIT_CENTER[MONTH] <= MONTH))
The error I'm getting occurs when I select a month that doesn't have any value to a specific ID_COST_CENTER / ID_ACCOUNT, as in the example below - in green what I expect to see in a card depending on the year/month selected and in red what I'm getting with the formula I'm using.
As you can see, when I select May, I'm getting a zero instead of 4306. In May the pair ID_COST_CENTER a / ID_ACCOUNT 123 doesn't exist, but I need to show the total for the year.
How can I change the formula to obtain the desired results?
Thanks for your help.
Jorge