Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

how to count measure value

Hi, 

 

I have Emp_ID, Dept, bonus and salary. I calculated bonus % in a measure and then another measure to with condition Bonus<= 5% then "Yes" else "No". 

 

Now I have Emp_ID, Dept, bonus % and yes/No in my view, I want to know how many employees we have yes in each dept or dept wise employees count who are yes in yes/no measure.

 

Thanks/ Rakesh

  • Anonymous's avatar
    Anonymous
    7 years ago

    Hi Lin, Awesome this work fine thanks !!

10 Replies

  • PattemManohar's avatar
    PattemManohar
    Icon for Community Champion rankCommunity Champion

    Anonymous Could you please show some sample data, the Bonus % you are calculating - Is it the bonus % of the employee out of their salary ?

     

    Sample data and expected output will be really helpful

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Rakesh,

     

    Are you looking for something like this?

    Count =
    CALCULATE (
        COUNTROWS ( ExampleTable );
        FILTER ( 'ExampleTable'; [Bonus] = "Yes" )
    )

     

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    You can have this in a new table:

     

    YesNoCount =
    SUMMARIZE (
        'Table',
        'Table'[Dept],
        "YesEmployees", COUNTROWS ( FILTER ( 'Table', 'Table'[Yes/No] = "Yes" ) )
            + 0,
        "NoEmployees", COUNTROWS ( FILTER ( 'Table', 'Table'[Yes/No] = "No" ) )
            + 0
    )
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi All,

       

      Thanks for the reply but Its not working seems I am missing unbale to attach file thus attaching screen shots for your refernce please help me in this. 

       

      Please follow the steps same as I did in the screen shot as this is an example I need to use same logic in different data which I can not share.  

       

      Here is data 

       

      Data Table- 

       

      Emp_IDBounsSalary
      116461811278
      200244819153
      134481816273
      163349514826
      154396518387
      164265017712
      174372419251
      182437915607
      186453815343
      105373614624
      161355816835
      135287814697
      117381015467
      153440117927
      176455512569
      195451919758
      132370814623
      171345918851
      142499116185
      141281018898
      119235214650
      156300710721
      189364215484
      107472712603
      181364011188
      148431918131
      188438717761
      167412217401
      126238414965
      185405518012
      138470313539
      127380314571
      183234413603
      177448216344
      175225714888
      166483719333
      128278711982
      160214517417
      190242018058
      104492414234
      103448811297
      150435216200
      178437412194
      109214710538
      121379116227
      101266914575
      133496116651
      140368611727
      180308916238
      114362111718
      106311011574
      194353612926
      139407517357
      100253211119

       

       

      Ref Table- 

       

      Emp_IDDep
      116Finance
      200Marketing
      134HR
      163IT
      154Operation
      164BI
      174DS
      182HR
      186IT
      105Operation
      161Finance
      135Finance
      117Marketing
      153DS
      176HR
      195DS
      132HR
      171Finance
      142Operation
      141BI
      119DS
      156Operation
      189Marketing
      107Finance
      181DS
      148HR
      188DS
      167IT
      126Finance
      185Marketing
      138DS
      127IT
      183Operation
      177Marketing
      175IT
      166Finance
      128Marketing
      160BI
      190IT
      104Operation
      103Finance
      150Marketing
      178Finance
      109Operation
      121Marketing
      101IT
      133Marketing
      140Finance
      180Finance
      114BI
      106DS
      194Operation
      139DS
      100HR

       

      something.