The first thing I needed to do was get the date of the past report, and pull it into a column. So I opened up the modeling tab, and put a new column into my fields using a query similar to this one:
Report Yesterday Date =
CALCULATE(MAX('Data'[Report Date]),
FILTER('Data', 'Data'[Report Date] < EARLIER('Data'[Report Date])))
This created a column with the previous date in it.
Then I created another column with the data from the previous day in it
Yesterday Data = CALCULATE(
SUM('Data'[Devices]),
FILTER('Data', 'Data'[Report Date] >= EARLIER('Data'[Report Yesterday Date])
&&'Data'[Report Yesterday Date]<EARLIER('Data'[Report Yesterday Date])
&&'Data'[Key Name]=EARLIER('Data'[Key Name]))
)
From there I can create my visuals based off of filtered dates, and generate my dashboard.
I think you might also need the help of another important aspect of Power BI about which I am referring in this post.
ReplyDeletePowerbi Read Rest