Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello my friends I need your help
I have the following table with its expressions:
ACCNT_CODE = Accounts
Debit = Sum({<[D_C]={"D"},[ACCNT_CODE]={"12*", "13*", "14*","32*", "33*", "34*","A*", "E*", "R*"}>}[AMOUNT])
Credit = Sum({<[D_C]={"C"},[ACCNT_CODE]={"12*", "13*", "14*","32*", "33*", "34*","A*", "E*", "R*"}>}[AMOUNT])
Balance = Sum({<[D_C]={"D"},[ACCNT_CODE]={"12*", "13*", "14*","32*", "33*", "34*","A*", "E*", "R*"}>}[AMOUNT]) + Sum({<[D_C]={"C"},[ACCNT_CODE]={"12*", "13*", "14*","32*", "33*", "34*","A*", "E*", "R*"}>}[AMOUNT])
As show
I want to do the sum the values that are positive in the Balance, is there a way to do this?
Thanks in advance
@JASalinas try below
=sum(aggr(if((Sum({<[D_C]={"D"},[ACCNT_CODE]={"12*", "13*", "14*","32*", "33*", "34*","A*", "E*", "R*"}>}[AMOUNT]) + Sum({<[D_C]={"C"},[ACCNT_CODE]={"12*", "13*", "14*","32*", "33*", "34*","A*", "E*", "R*"}>}[AMOUNT]))>0,
Sum({<[D_C]={"D"},[ACCNT_CODE]={"12*", "13*", "14*","32*", "33*", "34*","A*", "E*", "R*"}>}[AMOUNT]) + Sum({<[D_C]={"C"},[ACCNT_CODE]={"12*", "13*", "14*","32*", "33*", "34*","A*", "E*", "R*"}>}[AMOUNT]),0), Account))
@JASalinas try below
Sum({<[AMOUNT]={">0"},[D_C]={"D"},[ACCNT_CODE]={"12*", "13*", "14*","32*", "33*", "34*","A*", "E*", "R*"}>}[AMOUNT]) + Sum({<[AMOUNT]={">0"},[D_C]={"C"},[ACCNT_CODE]={"12*", "13*", "14*","32*", "33*", "34*","A*", "E*", "R*"}>}[AMOUNT])
Hi @Kushal_Chawda thank for you answer, I tried but in the balance column it show me the same as the credit column.
@JASalinas try below
if((Sum({<[D_C]={"D"},[ACCNT_CODE]={"12*", "13*", "14*","32*", "33*", "34*","A*", "E*", "R*"}>}[AMOUNT]) + Sum({<[D_C]={"C"},[ACCNT_CODE]={"12*", "13*", "14*","32*", "33*", "34*","A*", "E*", "R*"}>}[AMOUNT]))>0,
Sum({<[D_C]={"D"},[ACCNT_CODE]={"12*", "13*", "14*","32*", "33*", "34*","A*", "E*", "R*"}>}[AMOUNT]) + Sum({<[D_C]={"C"},[ACCNT_CODE]={"12*", "13*", "14*","32*", "33*", "34*","A*", "E*", "R*"}>}[AMOUNT]),0)
Hi @Kushal_Chawda Well we're moving on, show me the following
The sum is equal to zero, it is not doing the sum...
@Kushal_Chawda Yes, it already does the sum, but how can I do this in KPI? The KPI does not have the sum option.
@JASalinas try below
=sum(aggr(if((Sum({<[D_C]={"D"},[ACCNT_CODE]={"12*", "13*", "14*","32*", "33*", "34*","A*", "E*", "R*"}>}[AMOUNT]) + Sum({<[D_C]={"C"},[ACCNT_CODE]={"12*", "13*", "14*","32*", "33*", "34*","A*", "E*", "R*"}>}[AMOUNT]))>0,
Sum({<[D_C]={"D"},[ACCNT_CODE]={"12*", "13*", "14*","32*", "33*", "34*","A*", "E*", "R*"}>}[AMOUNT]) + Sum({<[D_C]={"C"},[ACCNT_CODE]={"12*", "13*", "14*","32*", "33*", "34*","A*", "E*", "R*"}>}[AMOUNT]),0), Account))
@Kushal_Chawda Uff, Excelent My Friend, Thank you very very much... It's work!....