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
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.
User | Count |
---|---|
12 | |
12 | |
8 | |
8 | |
6 |
User | Count |
---|---|
27 | |
19 | |
13 | |
11 | |
7 |