Forum Discussion

Bakhtawar's avatar
Bakhtawar
Post Patron
8 years ago
Solved

Groups by columns on Power BI

I have column in which 3-4 different values and data like this

companyname   servicestatus  employee
abc                        inservice         abc_e1
abc                        inservice         abc_ew1
abc                       resigned          abc_2
abc                      retired             abc_3
abc                      retired             abc_23
def                      inservice         def_12
def                      inservice         def_13
def                      inservice         def_14
def                     resigned          def_3
def                     resigned          def_4
def                     resigned          def_5
def                      retired            def_3

so currently this show data like this

companyname   servicestatus  count
    abc                        inservice         2
    abc                       resigned          1
    abc                      retired             2
    def                      inservice         3
    def                     resigned          3
    def                      retired            1

so on power bi i want to show like this

companyname   joiners    leavers
abc                       2               3
def                       3                4

means in joiners i want to show only inservice but on leavers i want to show resigned and retired both how i do this on power bi

  • Bakhtawar,

     

    Add a calculated column in DAX, then drag [companyname] to Rows and [Tag] to Columns in a Matrix visual.

     

    Tag =
    IF ( Table1[servicestatus] = "inservice", "joiners", "leavers" )
    

     

     

1 Reply

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

    Bakhtawar,

     

    Add a calculated column in DAX, then drag [companyname] to Rows and [Tag] to Columns in a Matrix visual.

     

    Tag =
    IF ( Table1[servicestatus] = "inservice", "joiners", "leavers" )