Forum Discussion
Calculated Measure/Column to show difference in value from last 7 days , last month, and last year
- 8 years ago
Not sure where I can place this file that you would be able to link into? Is there a standard place that people typically use? I think I figured out what I need to do.
Create a date slicer and select any individual date
Create new columns:
Current_Tag_Count_WTD_Difference = Data[Current_Tag_Count]-(CALCULATE(SUM(DATA[Current_Tag_Count]),DATEADD(Data[Report_Datetime],-7, DAY)))
Current_Tag_Count_MTD_Difference = Data[Current_Tag_Count]-(CALCULATE(SUM(DATA[Current_Tag_Count]),DATEADD(Data[Report_Datetime],-30, DAY)))
Current_Tag_Count_YTD_Difference = Data[Current_Tag_Count]-(CALCULATE(SUM(DATA[Current_Tag_Count]),DATEADD(Data[Report_Datetime],-365, DAY)))
This seems like it is pulling what I need though I need to do a few more data checks... unless there is a better way to get this.
I added these measures and included a date slicer but it is showing the same number for all three measures which is the Current Tag Count for the date I select.
Hi,
Share the link from where i can download your file. Also, show the correct result there.
- clarkbj8 years agoFrequent Visitor
Not sure where I can place this file that you would be able to link into? Is there a standard place that people typically use? I think I figured out what I need to do.
Create a date slicer and select any individual date
Create new columns:
Current_Tag_Count_WTD_Difference = Data[Current_Tag_Count]-(CALCULATE(SUM(DATA[Current_Tag_Count]),DATEADD(Data[Report_Datetime],-7, DAY)))
Current_Tag_Count_MTD_Difference = Data[Current_Tag_Count]-(CALCULATE(SUM(DATA[Current_Tag_Count]),DATEADD(Data[Report_Datetime],-30, DAY)))
Current_Tag_Count_YTD_Difference = Data[Current_Tag_Count]-(CALCULATE(SUM(DATA[Current_Tag_Count]),DATEADD(Data[Report_Datetime],-365, DAY)))
This seems like it is pulling what I need though I need to do a few more data checks... unless there is a better way to get this.