Forum Discussion
Difference Calculation Error based on Dates (month)
Hi Experts
See Sample Data - I am trying to work out the diference month on month starting at M0
So M0 = 202, M1 = M0-M1 and M2 = M1-M2 and so on
My Dax Measures are
1. Paydown = [Value]*[Percentage] (where i am getting the Max for the value and Percentage column)
2. Balance Paydown =
VAR _prevdate = Lastnonblank(
Filter(All('Input'[M Column]), 'Input'[M Column]>= SelectedValue('Input'[M Column])
),
[Paydown])
Return
Calculate([Paydown],'Input'[M Column]<=_prevdate)
Then a New Measure
Bal = if([Maxcolumn] = "M0", [Paydown], [Balance Paydown]-[Paydown])
Total lost
| M Column | Value | Percentage | Month |
| M0 | 202.0 | 100% | 01/02/2021 |
| M1 | 191.9 | 95% | 01/03/2021 |
| M2 | 172.7 | 90% | 01/04/2021 |
| M3 | 146.8 | 85% | 01/05/2021 |
| M4 | 117.4 | 80% | 01/06/2021 |
| M5 | 88.1 | 75% | 01/07/2021 |
| M6 | 61.7 | 70% | 01/08/2021 |
| M7 | 40.1 | 65% | 01/09/2021 |
| M8 | 24.0 | 60% | 01/10/2021 |
| M9 | 13.2 | 55% | 01/11/2021 |
| M10 | 6.6 | 50% | 01/12/2021 |
| M11 | 3.0 | 45% | 01/01/2022 |
| M12 | 1.2 | 40% | 01/02/2022 |
| M13 | 0.4 | 35% | 01/03/2022 |
| M14 | 0.1 | 30% | 01/04/2022 |
| M15 | 0.0 | 25% | 01/05/2022 |
| M16 | 0.0 | 20% | 01/06/2022 |
| M17 | 0.0 | 15% | 01/07/2022 |
| M18 | 0.0 | 10% | 01/08/2022 |
| M19 | 0.0 | 5% | 01/09/2022 |
| M20 | - | 0% | 01/10/2022 |
Anonymous , Please find attached file after signature
8 Replies
- amitchandakSuper User
Anonymous , Please find attached file after signature
- amitchandakSuper User
Anonymous , Can you share the expected output in the table. You can get a new column getting the last row value earlier.
- AnonymousNot applicable
- amitchandakSuper User
Anonymous , Try a new column
new column =
var _1 = maxx(filter(table, [month] <earlier([month])), [month])
return
Table[value] - maxX( filter(Table, [month] =_1),Table[value])+0
- AnonymousNot applicable
Hi Amit
I need this as a measure not a new column....the FACT table is more tricky then what i have shown