Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi,
I have an issue when using SUMX to sum Measure below, however, when I put it in Matrix Table, it shows "Query has exceeded the available resources.", is there any other formula that can sum Measure (or to make below Measure to sum itself when showing Subtotal or Grand Total)
Updated Measure
Active Count =
SUMX(
ADDCOLUMNS(
VALUES('YourTableName'[KeyColumn]),
"__ActiveResult", SWITCH(
TRUE(),
[__Active] = 1 && ([__Sales] > 0 || [Inventory] > 0), 1, BLANK()
)
),
[__ActiveResult]
)
💌 If this helped, a Kudos 👍 or Solution mark ✔️would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn
You could create a calculated table or a new measure that aggregates the data first and then applies the SUMX:
This way, you're only working with unique categories or groupings, which reduces the load.
Optimize the SWITCH Function: If the SWITCH function is causing heavy computation, you might want to simplify it or avoid unnecessary checks. For instance, check if it can be reduced to just one condition or if the data model could be simplified by preprocessing some calculations outside of DAX.
Use SUM instead of SUMX in Totals: In some cases, using SUM instead of SUMX can work better in terms of performance, particularly for totals or subtotals. However, this depends on your specific calculation.
You can try using SUM over a simplified version of your measure:
This approach calculates the Active Count for each row and then sums it up for subtotals and grand totals.
User | Count |
---|---|
64 | |
59 | |
47 | |
33 | |
32 |
User | Count |
---|---|
84 | |
75 | |
56 | |
50 | |
44 |