Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

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

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi Lin, Awesome this work fine thanks !!

View solution in original post

10 REPLIES 10
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
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. Screan shot 1.pngScrean shot 4.pngScrean shot 3.pngScrean shot 2.png

Anonymous
Not applicable

I have a pbix file with what you might be needing, let me know if this works:

 

https://files.fm/u/mevqpbu8

Hi Nikhil, 

 

Thanks for shring file but issue is reamin same.... You calculate Bonuspct and Yes/NO calculation in column but we need to do these calculation in measure because so that I can use these calculation in other way as well not only employee wise.

 

We need to do that in meausre and then we need to count Yes/No  measure on the basis of dep.

 

 

Anonymous
Not applicable

https://files.fm/u/5fpcddwp

 

Changed to measures.

 

Capture.PNG

Anonymous
Not applicable

Nikil, you are refring Yes/No and bonuspct in nocount and yescount measure but in my case yes/no and bonuspct also calculted in measure that is the issue. 

hi, @Anonymous

After my research, you may try to this way as below:

Step1:

Add two count measure

Yes = var _table=ADDCOLUMNS(Ref,"Yes/No",[Yes/No]) return
CALCULATE(COUNTROWS(FILTER(_table,[Yes/No]="Yes")))


No = var _table=ADDCOLUMNS(Ref,"Yes/No",[Yes/No]) return
CALCULATE(COUNTROWS(FILTER(_table,[Yes/No]="No")))

Step2:

Drag dep field and these two measure into table visual

3.png

 

here is pbix, please try it.

https://www.dropbox.com/s/emxxhz3n2mpck3f/how%20to%20count%20measure%20value.pbix?dl=0

 

Best regards

Lin 

 

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi Lin, Awesome this work fine thanks !!

Anonymous
Not applicable

Hi Rakesh,

 

Are you looking for something like this?

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

 

 

PattemManohar
Community Champion
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





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.