Forum Discussion
badkins2
5 years agoFrequent Visitor
Difference Between Two Snapshots
Hello, I have been researching in this community, but am new to DAX and have not been able to solve my problem. I have daily data coming into a SQL Server table showing a snapshot of future...
DataInsights
Super User
5 years ago
Try this solution.
1. Create a date table and mark it as a date table. You can use CALENDARAUTO, etc.
2. Create a relationship between the date table and data table on the Timestamp column:
3. Create measures:
Total Guests = SUM ( Table1[Guests] )
Total Revenue = SUM ( Table1[Revenue] )
One Day Change Guests =
VAR vAmountYesterday =
CALCULATE ( [Total Guests], DATEADD ( DimDate[Date], -1, DAY ) )
VAR vAmountToday = [Total Guests]
VAR vResult = vAmountToday - vAmountYesterday
RETURN
vResult
One Day Change Revenue =
VAR vAmountYesterday =
CALCULATE ( [Total Revenue], DATEADD ( DimDate[Date], -1, DAY ) )
VAR vAmountToday = [Total Revenue]
VAR vResult = vAmountToday - vAmountYesterday
RETURN
vResult
4. Create visuals: