How to create in-stream and in-memory calculations?
Learn how to create, format, and validate calculations using DAX code in eyko.
It walks users through:
Accessing the Assets tab to start a new calculation.
Defining a name, type (in-memory or in-stream), and target table.
Setting the data type and formatting options for the calculation output.
Writing and validating DAX code to perform transformations or metrics.
Saving and reviewing calculations for use in visual reports and dashboards.
Key Steps
Step 1: Access the Assets Tab 0:14
-
Navigate to the Assets tab within your design.
-
Click the Start button to begin creating a calculation.
Step 2: Name Your Calculation 0:26
-
Enter a name for your calculation. This name will identify it in the stream.
Step 3: Choose Calculation Type 0:37
-
Select the type of calculation:
-
In-memory: Executes a code snippet in real-time without storing data in the dataset.
-
In-stream: Runs a query during stream processing and adds results to a specified table.
-
Step 4: Select the Target Table 1:29
-
Choose the table where you want the calculation results to reside (e.g., Account Balances).
Step 5: Define Data Type 2:24
-
Select the appropriate data type for the calculation result (e.g., boolean, date-time, decimal, text).
Step 6: Formatting Options 2:44
-
Choose formatting options:
-
Comma separators
-
Currency presentation
-
Number of decimal places to display.
-
Step 7: Enter DAX Code 3:01
-
Switch to the Script tab to enter your custom DAX code.
-
This code will be executed at stream processing time.
Step 8: Validate DAX Code 3:28
-
Use the formatting validator button to check for syntax errors in your DAX code.
Step 9: Save the Calculation 4:10
-
Click Save to create the new calculation.
Step 10: Review Examples 4:27
-
Familiarize yourself with examples of in-memory and in-stream calculations to understand their applications.
Step 11: Explore DAX Learning Resources 5:30
-
Visit resources like sqlbi.com and dax.guide for additional learning on DAX coding and modeling.
Cautionary Notes
-
Ensure that the DAX code is correctly formatted to avoid syntax errors.
-
Be aware of the difference between in-memory and in-stream calculations to choose the appropriate type for your needs.
Tips for Efficiency
-
Use the formatting validator frequently to catch errors early.
-
Familiarize yourself with common DAX functions to speed up the coding process.
-
Keep a reference of frequently used calculations for quick access.