March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Bom dia a todos!
Eu estou tentando há alguns dias fazer a soma acumulativa de uma coluna no power bi que recomeçe a soma do zero quando o valor de outra coluna (na mesma linha) seja TRUE. No momento que consegui fazer a soma acumulativa e colocar zero nas linhas que tem o valor true, mas ela não reinicia a contagem da soma acumulativa após o zero, como deveria. Aqui esta a dax que tenho até agora. Alguém poderia me ajudar a fazer essa soma acumulativa da maneira correta?
Obrigado desde já.
@silveiralopesa , Try if this calculation can help
CumulativeSumBotrytis =
VAR CurrentDate = Donnes_SERRE1_2021_2023_test[Date]
VAR ResetGroup_ =
CALCULATE(
COUNTROWS(
FILTER(
ALL(Donnes_SERRE1_2021_2023_test),
Donnes_SERRE1_2021_2023_test[Date] <= CurrentDate &&
Donnes_SERRE1_2021_2023_test[Fungicide applications] = TRUE
)
),
ALL(Donnes_SERRE1_2021_2023_test)
)
RETURN
CALCULATE(
SUMX(
FILTER(
ALL(Donnes_SERRE1_2021_2023_test),
Donnes_SERRE1_2021_2023_test[Date] <= CurrentDate &&
CALCULATE(
COUNTROWS(
FILTER(
ALL(Donnes_SERRE1_2021_2023_test),
Donnes_SERRE1_2021_2023_test[Date] <= CurrentDate &&
Donnes_SERRE1_2021_2023_test[Fungicide applications] = TRUE
)
),
ALL(Donnes_SERRE1_2021_2023_test)
) = ResetGroup_
),
Donnes_SERRE1_2021_2023_test[ColuneBotrytis]
)
)
Hello swikritee_p, thanks for the answer, the cumulative sum works well, BUT it doesnt restarts when the value in the "Applications fongiques" column is "True". For each day we have more then one value in the column "ColuneBotrytis" (one value for each 30 minutes in the day). In the column "Applications fongiques", the "TRUE" or "FALSE" value is repeated in all rows concerning the same date. Maybe this requests a change in the DAX?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
129 | |
90 | |
75 | |
58 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |