Forum Discussion
Periodic Cumulative phasing
- 6 months ago
Snagalapur , If they in the same format they are sortable. You can use visual calculation running sum
Visual Calculations in Power BI- February 2024 Update RUNNINGSUM, RANGE, MOVINGAVERAGE, COLLAPSE, COLLAPSEALL, EXPAND, EXPANDALL, FIRST, LAST, PREVIOUS, and NEXT
https://www.youtube.com/watch?v=bKD9T0EWgQo&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
Else have Rank column in your table on YYYYPP (Year period )
Period Rank = RANKX(all(Period),Period[year period],,ASC,Dense)
Then you can measure
Cumm = CALCULATE(sum('Table'[Qty]), FILTER(ALL(Period),Period[Period Rank]<=max(Period[Period Rank])))
Also other measures
This Period = CALCULATE(sum('Table'[Qty]), FILTER(ALL(Period),Period[Period Rank]=max(Period[Period Rank])))
Last Period = CALCULATE(sum('Table'[Qty]), FILTER(ALL(Period),Period[Period Rank]=max(Period[Period Rank])-1))
Snagalapur , If they in the same format they are sortable. You can use visual calculation running sum
Visual Calculations in Power BI- February 2024 Update RUNNINGSUM, RANGE, MOVINGAVERAGE, COLLAPSE, COLLAPSEALL, EXPAND, EXPANDALL, FIRST, LAST, PREVIOUS, and NEXT
https://www.youtube.com/watch?v=bKD9T0EWgQo&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
Else have Rank column in your table on YYYYPP (Year period )
Period Rank = RANKX(all(Period),Period[year period],,ASC,Dense)
Then you can measure
Cumm = CALCULATE(sum('Table'[Qty]), FILTER(ALL(Period),Period[Period Rank]<=max(Period[Period Rank])))
Also other measures
This Period = CALCULATE(sum('Table'[Qty]), FILTER(ALL(Period),Period[Period Rank]=max(Period[Period Rank])))
Last Period = CALCULATE(sum('Table'[Qty]), FILTER(ALL(Period),Period[Period Rank]=max(Period[Period Rank])-1))
Thank you for your time.
I used below sample code to modify and this works
Cumulative Sales =
VAR MaxDate = MAX('DateTable'[Date])
RETURN
CALCULATE(
SUM('Sales'[Amount]),
FILTER(
ALLSELECTED('DateTable'),
'DateTable'[Date] <= MaxDate
)
)