Forum Discussion
idontexist
Helper I
8 years agoRepeat values based on other value
Hi all, I want to repeat values as you can see in column "should be plan". It should be based on column "Fact". If in this column there are any values so plan should be repeated. "Plan" i have 1 ...
Zubair_Muhammad
Community Champion
8 years agoHi idontexist
Try this calculated Column
Should_be_plan =
VAR FirstValue =
CALCULATE (
VALUES ( TableName[Plan] ),
FILTER (
ALL ( Tablename ),
MONTH ( TableName[Date] ) = MONTH ( EARLIER ( TableName[Date] ) )
&& TableName[Date]
= MINX (
FILTER (
ALL ( TableName ),
MONTH ( TableName[Date] ) = MONTH ( EARLIER ( TableName[Date] ) )
),
TableName[Date]
)
)
)
RETURN
IF ( NOT ( ISBLANK ( TableName[Fact] ) ), FirstValue )idontexist
Helper I
8 years ago
I've tried and it did not work. Red value below, it marks me as wrong. So formula do nothing.
Should_be_plan =
VAR FirstValue =
CALCULATE (
VALUES ( TableName[Plan] ),
FILTER (
ALL ( Tablename ),
MONTH ( TableName[Date] ) = MONTH ( EARLIER ( TableName[Date] ) )
&& TableName[Date]
= MINX (
FILTER (
ALL ( TableName ),
MONTH ( TableName[Date] ) = MONTH ( EARLIER ( TableName[Date] ) )
),
TableName[Date]
)
)
)
RETURN
IF ( NOT ( ISBLANK ( TableName[Fact] ) ), FirstValue )