Forum Discussion
samroth
Microsoft Employee
5 years agoCalculate count based on filter and if statement
I have a table with columns for branchName, stageName, date, and count of how many times that day a build from that branch successfully executed that stage. Something like this: BuildBranch ...
- 5 years ago
is there a logic that sna's count is always 1? if so you can try this.
Measure = sumx(FILTER('Table','Table'[BuildBranch]="Develop"),'Table'[Count])+CALCULATE(DISTINCTCOUNT('Table'[BuildBranch]),FILTER('Table','Table'[BuildBranch]<>"Develop"))please see the attachment
ryan_mayu
Super User
5 years agois there a logic that sna's count is always 1? if so you can try this.
Measure = sumx(FILTER('Table','Table'[BuildBranch]="Develop"),'Table'[Count])+CALCULATE(DISTINCTCOUNT('Table'[BuildBranch]),FILTER('Table','Table'[BuildBranch]<>"Develop"))
please see the attachment