Forum Discussion
rawmeat
8 years agoFrequent Visitor
previous value option
Hi all, I am trying to migrate one of the report from tableau to power bi. We have a table like below: Sample table: Name Date Value A 4/19 10 A 4/21 20 ...
- 8 years ago
Zubair_Muhammad
8 years agoCommunity Champion
Hi rawmeat
try this calculated table
From Modelling Tab>>NEW TABLE
New Table =
VAR AllCombinations =
CROSSJOIN ( VALUES ( Table1[Date] ), VALUES ( Table1[Name] ) )
RETURN
ADDCOLUMNS (
AllCombinations,
"Value",
VAR mydate =
CALCULATE (
MAX ( Table1[Date] ),
FILTER (
table1,
Table1[Name] = EARLIER ( [Name] )
&& Table1[Date] <= EARLIER ( [Date] )
)
)
RETURN
CALCULATE (
SUM ( Table1[Value] ),
FILTER ( Table1, Table1[Name] = EARLIER ( [Name] ) && Table1[Date] = mydate )
)
)