Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
I have page with matrix visual that has about 15 columns. I inherited this report and rcently new requirement came up which I made it work however measures I made are super slow. I noticed that visual loads forever so I run performance analyzer and then run DAx in DAX studio which helpoed me isolate some measures that are slow. My matrix is kind of designed this way
Rows are Country, State and City from Table_A
Columns are
Approval_2026, (measures related to this column are fast)
Rejections_2026 (measures related to this column are fast)
Approval_2025, (measures related to this column are slow)
Rejections_2025 (measures related to this column are slow)
...
---
I think problem is that for measures relaated to 2026 need to get geo data from Table_A but 2025 from Table_B while keeping the matrix rows with Country,State, City from Table_A. Measures (not 2026)I have currently are very much similar to each oother and was hoping for some advice how to speed this up.
CALCULATE (
[Approvals_2025],
REMOVEFILTERS (Table_A),
TREATAS ( VALUES ( Table_A[Country]), Table_B[Country]),
TREATAS ( VALUES ( Table_A[State]), Table_B[State] ),
TREATAS ( VALUES ( Table_A[City] ), Table_B[City] )
)
Solved! Go to Solution.
Approvals_2025 =
CALCULATE (
[Approvals_2025],
REMOVEFILTERS ( Table_A ),
TREATAS (
-- Creates a table of only valid, existing combinations
SUMMARIZE (
Table_A,
Table_A[Country],
Table_A[State],
Table_A[City]
),
-- Maps them directly to the corresponding columns in Table_B
Table_B[Country],
Table_B[State],
Table_B[City]
)
)While the TREATAS DAX solution (a "virtual relationship") will improve performance, virtual relationships are resolved entirely at query time and do not benefit from the internal structures and indexes the engine uses to optimize physical relationships.
For the best possible performance, If its permit in you model, you should eliminate the virtual relationship and rely on a Star Schema data model.
If this helped, please consider giving kudos and mark as a solution
@mein replies or I'll lose your thread
Hi @stribor45
May I check if this issue has been resolved? If not, Please feel free to contact us if you have any further questions.
Thank you
Hi @stribor45
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.
Thank you.
Approvals_2025 =
CALCULATE (
[Approvals_2025],
REMOVEFILTERS ( Table_A ),
TREATAS (
-- Creates a table of only valid, existing combinations
SUMMARIZE (
Table_A,
Table_A[Country],
Table_A[State],
Table_A[City]
),
-- Maps them directly to the corresponding columns in Table_B
Table_B[Country],
Table_B[State],
Table_B[City]
)
)While the TREATAS DAX solution (a "virtual relationship") will improve performance, virtual relationships are resolved entirely at query time and do not benefit from the internal structures and indexes the engine uses to optimize physical relationships.
For the best possible performance, If its permit in you model, you should eliminate the virtual relationship and rely on a Star Schema data model.
If this helped, please consider giving kudos and mark as a solution
@mein replies or I'll lose your thread
Replace 3 TREATAS calls with 1 SUMMARIZE bridge:
Bridge_2025 =
SUMX(
SUMMARIZE(Table_A, Table_A[Country], Table_A[State], Table_A[City]),
CALCULATE([Base_2025])
)
Approval_2025 = [Bridge_2025]
Rejection_2025 = [Bridge_2025]
sorry I made typos in my original code snipped. I adjusted it now
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 22 | |
| 13 | |
| 10 | |
| 6 | |
| 5 |