Join 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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello,
I need to summarize a table to use it within a SUMX function. The creation of the table works as expected because I created a calculated table to check it.
DAX
Var Weighted_Score = CALCULATETABLE(
ADDCOLUMNS(
SUMMARIZE('OpenWells Principal', 'Responsável'[Responsável], 'Intervenções'[Intervenções], 'Dados Sondas'[Casco / Capacidade]),
"Nota5", [Nota Logística 5],
"Proporcao", [Proporçao Un Operacional]
)
)Then I use this table in SUMX:
DAX
Var Sum_Score = SUMX(Weighted_Score, [Nota5] * [Proporcao])
What's happening strangely is that within the [Nota Logística 5] measure, there's a condition for when another measure called [Principal total OW (P50)] is equal to zero. The condition is as follows:
DAX
Nota Logística 5 =
Var Realized = [Principal total OW (P50)]
Var Target = [Meta P50 logística]
Var Score4 = [Nota Logística 4]
Var Total_tt = [Principal total OW operações (hs)]
SWITCH(TRUE(),
Realized > 0 && Target > 0, Score4,
Target = BLANK() && Total_tt > 0, 50,
OR(Realized = 0, Realized = BLANK()) && Total_tt > 0, 100
)
So, when I insert the virtual table into the SUMX, the condition is completely ignored. Everything is normal in the virtual table, as can be seen in the table below.
However, when this table enters as a variable within the SUMX, it cannot calculate the score when [Principal total OW (P50)] = zero. It looks like this:
Thank you all!!
Use EVALUATEANDLOG to observe the different filter contexts, the transitions, and the lineages. Then refactor your code to achieve your requirement. For development work you should avoid nesting measures inside each other, that makes it really hard to troubleshoot.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 4 | |
| 4 | |
| 2 |
| User | Count |
|---|---|
| 13 | |
| 12 | |
| 9 | |
| 8 | |
| 7 |