Forum Discussion
IF AND SUMIF OR
- 6 years ago
Hi,
This calculated column formula works
=if(AND(CALCULATE(SUM(Data[hours]),FILTER(Data,Data[Name]=EARLIER(Data[Name])))>=10,Data[method]="face"),"Eng",IF(AND(CALCULATE(SUM(Data[hours]),FILTER(Data,Data[Name]=EARLIER(Data[Name])))>=20,OR(Data[method]="online",Data[method]="face")),"PS",IF(AND(Data[status]="pass",Data[priority]="CS"),"Up","Unknown")))Hope this helps.
- 6 years ago
Anonymous - I did find one slight error in Anonymous's formula so I corrected it and did some formatting. PBIX is attached.
Result Output = VAR __Sum = SUMX(FILTER(ALL('Table'),[Name]=EARLIER([Name])),[hours]) RETURN SWITCH( TRUE(), __Sum >= 10 && [method]="face","Eng", __Sum >= 20 && ([method]="face" || [method]="online"),"PS", [status] = "pass" && [priority] = "CS","Up", "Unknown" )
Please see what am trying to archieve in none code format :
Anonymous - I did find one slight error in Anonymous's formula so I corrected it and did some formatting. PBIX is attached.
Result Output =
VAR __Sum = SUMX(FILTER(ALL('Table'),[Name]=EARLIER([Name])),[hours])
RETURN
SWITCH(
TRUE(),
__Sum >= 10 && [method]="face","Eng",
__Sum >= 20 && ([method]="face" || [method]="online"),"PS",
[status] = "pass" && [priority] = "CS","Up",
"Unknown"
)- Anonymous6 years agoNot applicable
Greg_Deckler Thanks for your help, I created a matrix with the result of the calculated column and DISTINCTCOUNT(id) for my measure as I want to distinct count of the id but the total is not suming up. I have updated my table with a new column "ID" . And also attached pictures of my table and matrix visual .
culated column and
Name hours method status priority Result Output ID Ade -15 face pass CS Up 57YE43YGD Ade 5 face pass CS Up 57YE43YGD ade 5 face pass CS Up 57YE43YGD Ade 5 face pass CS Up 57YE43YGD Ade 5 online pass cs Up 57YE43YGD Alex 5 face pass cs Eng 87HBDGD Alex 5 face cs Eng 87HBDGD Alex 5 online cs PS 87HBDGD Alex 5 online cs PS 87HBDGD Alex 5 online cs PS 87HBDGD Alex 5 online cs PS 87HBDGD Alex 5 face CS Eng 87HBDGD Chris 5 face fail wweee Eng OU2809 chris 5 face fail wweee Eng OU2809 chris 5 face fail wweee Eng OU2809 Chris 5 online fail wweee PS OU2809 chris 5 online fail wweee PS OU2809 chris 5 online fail wweee PS OU2809 Chris 5 online fail wweee PS OU2809 chris 5 face fail wweee Eng OU2809 chris 5 face fail wweee Eng OU2809 Ola 5 face fail wweee Eng URH879 ola 5 face fail wweee Eng URH879 Tobi 5 online fail wweee PS HGT153 tobi 5 face fail wweee Eng HGT153 tobi 10 face fail wweee Eng HGT153 - Ashish_Mathur6 years agoSuper User
Hi,
Your question is not clear. What exact result do you want?
- Anonymous6 years agoNot applicable
I want disticnt count of ID
- Anonymous6 years agoNot applicable
Please I need help with the excel formula in Dax.
Sample data and excel formula below
=IF(AND(SUMIF(A:A,A2,B:B)>=10,C2="face"),"Engaged","Unknown")
A B C D
Name hours method Output Ade -15 face Unknown Tobi 5 online Unknown Ade 5 face Unknown Ola 5 face Engaged tobi 10 face Engaged ade 5 face Unknown tobi 10 face Engaged ola 5 face Engaged Ade 5 face Unknown Ade 5 online Unknown Chris 5 face Engaged chris 5 face Engaged chris 5 face Engaged Chris 5 online Unknown chris 5 online Unknown chris 5 online Unknown Chris 5 online Unknown chris 5 face Engaged chris 5 face Engaged Alex 5 face Engaged Alex 5 face Engaged Alex 5 online Unknown Alex 5 online Unknown Alex 5 online Unknown Alex 5 online Unknown Alex 5 face Engaged Greg_Deckler Ashish_Mathur Anonymous
- Ashish_Mathur6 years agoSuper User
Hi,
Try this calculated column formula
=IF(AND(Data[method]="face",CALCULATE(SUM(Data[hours]),FILTER(Data,Data[Name]=EARLIER(Data[Name])))>=10),"Engaged","Unknown")Hope this helps.