Forum Discussion
13havya
2 years agoFrequent Visitor
Dynamically calculate sum for current and historical data
Hi, I am trying to develop a measure that returns the amount of money held in unresolved files. The metric needs to show the values at any point in time, and not just the live data. To facilitate...
- 2 years ago
Hi 13havya ,
You can try below measure.
$ Debt = LASTNONBLANKVALUE( Dim_Date[Date], // use the row label field of matrix. VAR Live = CALCULATE (SUMX(FILTER(Fact table, report = "Live" && {conditions}), debt_amt), userelationship(timestamp, date)) Var Historical = CALCULATE (SUMX(FILTER(Fact table, report = "Historical" && {conditions}), debt_amt)),userelationship(timestamp, date)) RETURN IF (YEAR(Max(Dim_Date[Date])) = YEAR(TODAY) && MONTH(MAX(Dim_Date[Date])) = MONTH(TODAY), Live, Historical) )Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !
Thank you~
xifeng_L
Super User
2 years agoHi 13havya ,
You can try below measure.
$ Debt =
LASTNONBLANKVALUE(
Dim_Date[Date], // use the row label field of matrix.
VAR Live = CALCULATE (SUMX(FILTER(Fact table, report = "Live" && {conditions}), debt_amt), userelationship(timestamp, date))
Var Historical = CALCULATE (SUMX(FILTER(Fact table, report = "Historical" && {conditions}), debt_amt)),userelationship(timestamp, date))
RETURN
IF (YEAR(Max(Dim_Date[Date])) = YEAR(TODAY) && MONTH(MAX(Dim_Date[Date])) = MONTH(TODAY), Live, Historical)
)
Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !
Thank you~