Forum Discussion
jacko11
4 years agoFrequent Visitor
Combining two columns after the latest value
Hello, I have two columns and I want to combine these two columns after the latest value. Could you please help me? Example: Date Column A Column B Combined Column A and B 2022-...
- 4 years ago
This calculates the max date of column B and then uses it till it gets to the date and then to A. Snippet and sample file is also attached.
A+B = VAR MaxDateB = CALCULATE ( MAX ( 'Table'[Date] ), FILTER ( 'Table', NOT ( ISBLANK ( 'Table'[B] ) ) ) ) RETURN IF ( 'Table'[Date] <= MaxDateB, 'Table'[B], 'Table'[A] )
jacko11
4 years agoFrequent Visitor
Hi moizsherwani,
Thank you for your answer.
I meant till to the last value on column B, it should get the values from column B which 750 in the example, then column A.
- moizsherwani4 years ago
Continued Contributor
This calculates the max date of column B and then uses it till it gets to the date and then to A. Snippet and sample file is also attached.
A+B = VAR MaxDateB = CALCULATE ( MAX ( 'Table'[Date] ), FILTER ( 'Table', NOT ( ISBLANK ( 'Table'[B] ) ) ) ) RETURN IF ( 'Table'[Date] <= MaxDateB, 'Table'[B], 'Table'[A] )