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" )
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 |
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
Ashish_Mathur What I want is disticnt coung of ID
- Ashish_Mathur6 years agoSuper User
Hi,
Write this measure
=Distinctcount(Data[ID])
Hope this helps.
- Anonymous6 years agoNot applicable
That was the measure I created but the total was not adding up