Forum Discussion
jbajon
5 years agoFrequent Visitor
Unexpected Running Total
How do I create a running (cumulative) sum of column C if column C = Column A divided by Column B. The problem seems to be that whenever a YTD function or Calculate with <= dates, it recalculates th...
- 5 years ago
jbajon , Try a measure like
calculate(sumx(values(Table[date]), calculate(divide(sum(Table[A]),Sum(Table[B])))), filter(AllSelected(Table), Table[date] <=max(Table[date])))
FarhanAhmed
5 years agoCommunity Champion
_Test 2 =
var a = CALCULATE(SUM('Table'[Column A]),FILTER(ALL('Table'),'Table'[Date]<=MAX('Table'[Date])))
var b = MAXX('Table',MAX('Table'[Column B]))
Return
DIVIDE(a,b)- jbajon5 years agoFrequent Visitor
Hi FarhanAhmed,
Thank you for your response. When attempting your solution I was getting an error message that MAX() only accepts column references where [Column B] is actually a measure in this example.