Forum Discussion
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
- Anonymous7 years ago
Hi Lin, Awesome this work fine thanks !!
10 Replies
- PattemManohar
Community 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
- AnonymousNot applicable
Hi Rakesh,
Are you looking for something like this?
Count =
CALCULATE (
COUNTROWS ( ExampleTable );
FILTER ( 'ExampleTable'; [Bonus] = "Yes" )
) - AnonymousNot 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
)- AnonymousNot 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_ID Bouns Salary 116 4618 11278 200 2448 19153 134 4818 16273 163 3495 14826 154 3965 18387 164 2650 17712 174 3724 19251 182 4379 15607 186 4538 15343 105 3736 14624 161 3558 16835 135 2878 14697 117 3810 15467 153 4401 17927 176 4555 12569 195 4519 19758 132 3708 14623 171 3459 18851 142 4991 16185 141 2810 18898 119 2352 14650 156 3007 10721 189 3642 15484 107 4727 12603 181 3640 11188 148 4319 18131 188 4387 17761 167 4122 17401 126 2384 14965 185 4055 18012 138 4703 13539 127 3803 14571 183 2344 13603 177 4482 16344 175 2257 14888 166 4837 19333 128 2787 11982 160 2145 17417 190 2420 18058 104 4924 14234 103 4488 11297 150 4352 16200 178 4374 12194 109 2147 10538 121 3791 16227 101 2669 14575 133 4961 16651 140 3686 11727 180 3089 16238 114 3621 11718 106 3110 11574 194 3536 12926 139 4075 17357 100 2532 11119 Ref Table-
Emp_ID Dep 116 Finance 200 Marketing 134 HR 163 IT 154 Operation 164 BI 174 DS 182 HR 186 IT 105 Operation 161 Finance 135 Finance 117 Marketing 153 DS 176 HR 195 DS 132 HR 171 Finance 142 Operation 141 BI 119 DS 156 Operation 189 Marketing 107 Finance 181 DS 148 HR 188 DS 167 IT 126 Finance 185 Marketing 138 DS 127 IT 183 Operation 177 Marketing 175 IT 166 Finance 128 Marketing 160 BI 190 IT 104 Operation 103 Finance 150 Marketing 178 Finance 109 Operation 121 Marketing 101 IT 133 Marketing 140 Finance 180 Finance 114 BI 106 DS 194 Operation 139 DS 100 HR something.
- AnonymousNot applicable
I have a pbix file with what you might be needing, let me know if this works: