Forum Discussion
RLOH
3 years agoFrequent Visitor
Running Total
Hi My excel table is downloaded from SAP, there is column for Fiscal Year, and another column for Posting Period (which indicate 1, 2 , 3 etc representing the month). May i know how to generate DA...
- 3 years ago
RLOH See if this helps: Better Running Total - Microsoft Power BI Community. In your case it would be something like:
Better RT = VAR __Year = MAX('Table'[Fiscal Year]) VAR __Month = MAX('Table'[Posting Period]) VAR __YearMonth = __Year * 100 + __Month VAR __Table = FILTER(ALLSELECTED('Table'), [Fiscal Year] * 100 + [Posting Period] <= __YearMonth ) RETURN SUMX(__Table,[Value]) - 3 years ago
File attached. See signature.
Greg_Deckler
3 years agoCommunity Champion
RLOH See if this helps: Better Running Total - Microsoft Power BI Community. In your case it would be something like:
Better RT =
VAR __Year = MAX('Table'[Fiscal Year])
VAR __Month = MAX('Table'[Posting Period])
VAR __YearMonth = __Year * 100 + __Month
VAR __Table = FILTER(ALLSELECTED('Table'), [Fiscal Year] * 100 + [Posting Period] <= __YearMonth )
RETURN
SUMX(__Table,[Value])RLOH
3 years agoFrequent Visitor
Greg_Decklerthanks for the solution, it works! However, the running total continue to add the value to another year, Please refer below the column chart visual, you can see that the 2023 value continue to add on from year 2022.. But when i use Card Visual and filter only year 2023, the value for 2023 is correct. May i know how to fix this ?
Thanks for your help!