Forum Discussion
MidtownMo
4 years agoHelper I
Creating a column based on another calculated column
Hi. I need to report on two metrics: the latest date in a table and one week prior to the latest date.
I successfully created a Latest Date column as such...
1 Latest Date =
2 VAR LatestDate =
3 CALCULATE ( MAX ( 'Table'[Date] ), ALL ( 'Table' ) )
4 RETURN
5 LatestDate
But when trying to create a column that is one week before the LatestDate I tried this but it does not work...
1 Latest Date Week Ago =
2 VAR LatestDateWeekAgo =
3 CALCULATE (DATEADD('Table'[Latest Date], -7, DAY))
4 RETURN
5 LatestDateWeekAgo
Hoping the community can help me out and thanks in advance!
If this is another column in the same table, why not just use
Latest Date Week Ago = [Latest Date] - 7
Pat
2 Replies
- mahoneypatMicrosoft Employee
If this is another column in the same table, why not just use
Latest Date Week Ago = [Latest Date] - 7
Pat
- MidtownMoHelper I
Well, that was easy! Thanks so much!