Forum Discussion
ssharm43
6 years agoHelper I
Need Help in calculating sum with condition
Hello guya, Hope you all are safe, I have a requirment where I need to calculate sum of quantity based on certain filter and condition. conditions are: 1. if Type = "inf" then only calculate sum ...
- 6 years ago
You can just add that into the Calculate()
SumIF inf %A% = CALCULATE ( SUM ( 'Type'[QUANTITY] ), 'Type'[QUANTITY] > 0, FILTER ( 'Type', OR ( 'Type'[Type] <> "inf", AND ( 'Type'[Type] = "inf", SEARCH ( "{A}", 'Type'[Con_type],, 0 ) > 0 ) ) ) )If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
mahoneypat
6 years agoMicrosoft Employee
You can just add that into the Calculate()
SumIF inf %A% =
CALCULATE (
SUM ( 'Type'[QUANTITY] ),
'Type'[QUANTITY] > 0,
FILTER (
'Type',
OR (
'Type'[Type] <> "inf",
AND ( 'Type'[Type] = "inf", SEARCH ( "{A}", 'Type'[Con_type],, 0 ) > 0 )
)
)
)
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
ssharm43
6 years agoHelper I
It didn't perfectly, but it gave me a Idea which worked for me.
Thank you very much for your help