Forum Discussion

samroth's avatar
samroth
Microsoft Employee
5 years ago
Solved

Calculate 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 ...
  • ryan_mayu's avatar
    5 years ago

    samroth 

    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