Forum Discussion
squiddly
8 years agoAdvocate I
Difference From Previous Week With Filters
I've seen similar topics but I think my case goes a bit further. I have a database with about 3 million rows and growing of data. There's a lot more to this data, but the relevent (and fuzzed) colu...
- 8 years ago
Hi squiddly
Please try adding this calculated column to your table. Just replace the text 'Table1' with your own table name. Remember to format the column as approprate.
Column = VAR LastWeekComp = SUMX( FILTER( 'Table1', 'Table1'[Location] = EARLIER('Table1'[Location]) && 'Table1'[Date] = EARLIER('Table1'[Date])-7 && 'Table1'[CVE] = EARLIER('Table1'[CVE]) ) ,'Table1'[Compliant]) VAR Compliant = 'Table1'[Compliant] RETURN Compliant - LastWeekComp
parry2k
8 years agoSuper User
First foremost you need calendar table in your data model for any time based calculation, either it is previous month/week/year etc. You need to start with that then go from there. There are many posts on how to create calendar table in PowerBI which can get started you on that.