Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
The total is wrong, I really dont know why.
Print: imgur.com/a/5mbub
---------
Estoque Disponível VAR e IF =
VAR x = SUMX(SUMMARIZE(ESTOQUE;ESTOQUE[PRODUTO];ESTOQUE[SALDO]);ESTOQUE[SALDO]) // SALDO
VAR y = CALCULATE([Total Pendência];ALL(CALENDARIO[Data])) // PENDENCIA
VAR z = ALLSELECTED(CALENDARIO[Data])
RETURN CALCULATE(IF(x = 0;BLANK();IF(x - y < 0;BLANK();x - y))
;z)
---------
Solved! Go to Solution.
Hi @gcz,
You want the total to be the sum of the several lines correct?
So you need to do the SUMX of the Calculate function you have on your Return, like you have the formula setup you are making the calculations for the total rows and then using the IF, because the measure is based on context.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @gcz,
You want the total to be the sum of the several lines correct?
So you need to do the SUMX of the Calculate function you have on your Return, like you have the formula setup you are making the calculations for the total rows and then using the IF, because the measure is based on context.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsI created this code:
Estoque Disponível VAR e IF by Felipe =
VAR x = SUMX(SUMMARIZE(ESTOQUE;ESTOQUE[PRODUTO];ESTOQUE[SALDO]);ESTOQUE[SALDO]) // SALDO
VAR y = CALCULATE([Total Pendência];ALL(CALENDARIO[Data])) // PENDENCIA
VAR z = ALLSELECTED(CALENDARIO[Data])
RETURN SUMX(VALUES(PRODUTOS[PRO_CODPRO]);CALCULATE(IF(x = 0;BLANK();IF(x - y < 0;BLANK();x - y));z))
______________________________________________________________________________________________________________________
Still the same error, total is different.
Print: imgur.com/a/pj5HY
And I created a code to give me the correct total:
TOTAL Estoque Disponível VAR e IF = SUMX(VALUES(PRODUTOS[PRO_CODPRO]);ESTOQUE[Estoque Disponível VAR e IF])
But which table I need to use in the SUMX?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
100 | |
99 | |
76 | |
67 | |
61 |
User | Count |
---|---|
142 | |
106 | |
103 | |
85 | |
70 |