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. 

  • 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.

6 Replies

  • Hi,

    Try this

    =calculate(distinctcount(data[EmpID]),Data[Source]="On-Premise"||Data[Source]="On-Clound")

    Hope this helps.

    • Anan's avatar
      Anan
      New Member

      Thank you, but I would like to check through both On-Premise and On-Cloud Source via Status Column.

       

      how can i do it ğŸ˜¥

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Super User

        Hi,

        I do not understand what you mean by "via Status Column"?  Please clarify.

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Community Support

    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.