Forum Discussion

Anan's avatar
Anan
New Member
4 years ago
Solved

DAX function check status

I want to create a DAX function to find employee count with both On-Premise and On-Clound Source via Status Column.   Please help me. 
  • v-yalanwu-msft's avatar
    4 years ago

    Hi, Anan ;

    You could create meaure as follows:

    count = CALCULATE(DISTINCTCOUNT('Table'[Source]),FILTER(ALLEXCEPT('Table','Table'[EmpID]),([Source]="On Cloud"&&[Status]=1)||([Source]="On Premise"&&[Status]=1)))
    both = COUNTROWS(SUMMARIZE(FILTER('Table',[count]=2),[EmpID]))

    The final output is shown below:


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.