Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi everyone. I'm having trouble with a small dax formula: it consumes a lot of memory and i can't add anymore rows to a mtarix because of it. The formula is the following:
It was one of my first ever formulas on power bi and now im coming back to upgrade it so i can add more rows to a matrix i have. How can i optimize this formula?
Thank you in advance
Hi @Gonqq ,
Has your problem been solved? If it is solved, please mark a reply which is helpful to you.
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
I'm surprised this is slow, so I'm assuming you have many combinations of values based on the columns used in the matrix. I would first look at the query behind the matrix using Performance Analyzer and try to reduce granularity. If that can't be improved, I would use nested IF functions instead of SWITCH(TRUE(). Your expression forces all 3 variables to be evaluated every time. Try to nest them so that you eliminate the most early on.
NewExpression =
IF (
SELECTEDVALUE ( Contas[Grupo Conta] ) <> 62,
"N/A",
IF (
SUM ( Principal[Real] ) > 0,
"N/A",
IF (
SUM ( Principal[PO] ) > 0,
"N/A",
GE
)
)
)
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
@Gonqq One way would be to have your GE row be this:
VAR GE = DIVIDE(R; P; "N/Orc")
Hi @Greg_Deckler , thank you. I tried it out and it still pulls a lot of memory. I'm almost certain that it's the switch condition that's causing the problem but i really must have that condition.
@Gonqq Try: VAR C = IF(gc + R + P = 62, "n.a";GE)
Arithmatic is faster than comparison operators and no need for a SWITCH if it is just a single condition.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
81 | |
42 | |
30 | |
27 | |
27 |