Forum Discussion
Separate and sum
- 5 years ago
See if this meets your needs.
Hi Analitika ,
Please refer to this measure:
Measure =
var
c_o_d_ = SELECTEDVALUE('Table'[Cred or Deb])
var
sas_ = LEFT(MAX('Table'[Sas_kod]),1)
return SWITCH(TRUE(),
c_o_d_="Deb"&&sas_ in {"0","1"},CALCULATE(SUM('Table'[deb]),ALLEXCEPT('Table','Table'[Sas_kod])),
c_o_d_="Cred"&&sas_ in {"0","1"},CALCULATE(SUM('Table'[cred]),ALLEXCEPT('Table','Table'[Sas_kod])),
SUM('Table'[cred])-SUM('Table'[deb]))
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Analitika5 years agoPost Prodigy
V-lianl-msft ty for reply
on big data it work wrong
as
c_o_d_="Deb"&&sas_ in {"0","1"},CALCULATE(SUM('Table'[deb]),ALLEXCEPT('Table','Table'[Sas_kod]))never been hapen as formula Cred or Deb always choose cred value
also this should be done only in measure as many other measures is linked to period and it cant be dublicate
it should be like
Cred or Deb =
IF (
Left([sas_kod],1) in {"0","1"} && [cred] <>0 && [deb] <>0, "Cred and Deb",
IF ( Left([sas_kod],1) in {"0","1"} && [cred] <>0, "Cred", "Deb")
)and measure
if "cred and deb" then credsum = [cred]-0 and debsum =0 - [deb]i didnt see deb at all, and all Sum values is same
- V-lianl-msft5 years agoCommunity Support
See if this meets your needs.