Forum Discussion
RafaelRSantos_
4 years agoFrequent Visitor
Sum total previous date filtered
Hi,
I need help to create a measure to Sum Total Value before the date specified in slice.
I have a stars chema
FactAccountingMoviment
SkDimDate
SkDimAccount
CreditValueMoviment
DebtValueMoviment
DimDate
SkDimDate
Date
DimAccount
SkDimAccount
Account
Follows the desired layout
| Account | Date | Previous Balance | Credit Moviment | Debt Moviment | Period Moviment | Actual Balance |
| 6.0.1.2.3 | 23/out | 100 | 5 | 2 | 3 | 103 |
| 6.0.1.2.3 | 24/out | 103 | 7 | 4 | 3 | 106 |
| 6.0.1.2.3 | 25/out | 106 | 5 | 1 | 4 | 110 |
I need the previous ballance dax calc
I look around documentation and inside forum and i create this result.
PreviousBalance =VAR MinDate = CALCULATE( MIN('Public DimDate'[Date]), ALLSELECTED('Publico DimDate'[Date]) )RETURNCALCULATE(SUMX('Account FactAccountingMoviment','Account FactAccountingMoviment'[CreditValue] - 'Account FactAccountingMoviment'[DebtValue]),FILTER(ALL('Public DimDate'),'Public DimDate'[Date] < MinDate))
1 Reply
- RafaelRSantos_Frequent Visitor
I look around documentation and inside forum and i create this result.
PreviousBalance =VAR MinDate = CALCULATE( MIN('Public DimDate'[Date]), ALLSELECTED('Publico DimDate'[Date]) )RETURNCALCULATE(SUMX('Account FactAccountingMoviment','Account FactAccountingMoviment'[CreditValue] - 'Account FactAccountingMoviment'[DebtValue]),FILTER(ALL('Public DimDate'),'Public DimDate'[Date] < MinDate))