Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I have a million rows of hierarchical data which looks like this:
ID | Path | Level | Cost | PathCost | Code |
1 | 1 | 0 | 10 | 120 | |
2 | 1|2 | 1 | 15 | 110 | XXX |
3 | 1|2|3 | 2 | 20 | 95 | |
4 | 1|2|3|4 | 3 | 10 | 25 | |
5 | 1|2|3|4|5 | 4 | 5 | 5 | |
6 | 1|2|3|4|6 | 4 | 10 | 10 | YYY |
7 | 1|2|3|7 | 3 | 20 | 50 | |
8 | 1|2|3|7|8 | 4 | 15 | 20 | |
9 | 1|2|3|7|8|9 | 5 | 5 | 5 | ZZZ |
10 | 1|2|3|7|10 | 4 | 10 | 10 |
PathCost is a calculated column which calculates the costs for every row. Costs are cumulated from every row that contain row's path. This is the code for the PathCost column:
Hi @veikko ,
Please try using a measure instead of calculated column and then output them as tabular visuals.
athCost =
VAR Id_ = max([Id])
RETURN
SUMX (
FILTER (
all(COSTS),
FIND(Id_, COSTS[Path], 1, BLANK()) > 0
),
[Cost]
)
For more information about DAX optimization, you can refer to:
Performance Tuning DAX - Part 1 - Microsoft Power BI Community
DAX Best Practices | MAQ Software Insights
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
111 | |
92 | |
84 | |
66 |