The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello everyone,
In my reports I use a DAX function to create a calculated column containing the difference between two temperature values in adjacent rows of the same column. In order to get it right, I need to filter on two other columns containing unit id and timestamp. This results in a very unfortunate situation, where I have to call the extremely memory intensive EARLIER function, which is ~ O(n^2) twice for each row inside a filter function that evaluates the entire table. As a result, using this function on a ~42K row table consumes nearly 16 GB ram (returns an error on an 8 GB machine) and is of course very slow. This is what it looks like:
Hi @h4tt3n
the EARLIER functionality can be replaced by using variables to store the current values that you want to you in your filter.
Something like:
Measure =
VAR currentTimestamp = Data[Timestamp]
return
....
filter (
data,
Data[Timestamp] > currentTimestamp)
...
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
35 | |
14 | |
12 | |
9 | |
7 |