Countif solution in DAX

Lars1

Board Regular
Joined
Feb 3, 2021
Messages
158
Office Version
  1. 365
Platform
  1. Windows
I have some data i would like to present in Power BI but i can't figure it out.
I would like to count how many times an employee or a supervisor appear in my data.

I can do it in Excel with Countif, but i would like to do it in Power Bi.
How to do this ?
MrExcel.png
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Unpivot the data in power query, then it's just a simple row count.
 
Upvote 0
Click Transform Data, select the date column, then right-click and choose Unpivot other columns. You will then have a table with three columns: Date, Attribute, Value (you can rename the last two to something like Role and Name). Wherever you need the count for an employee you can use a simple row count measure.
 
Upvote 0
Click Transform Data, select the date column, then right-click and choose Unpivot other columns. You will then have a table with three columns: Date, Attribute, Value (you can rename the last two to something like Role and Name). Wherever you need the count for an employee you can use a simple row count measure.
Ok. Thank you for your help.
My mistake that i did not specify that the data contains a lot more data i also use.
What i need is a solution where i still got all the rest of the data available and that there is a relation.
 
Upvote 0
Depending on what exactly you are doing, you may need to separate the names into a separate query/table and unpivot them there, with a key to link them back to the original data.
 
Upvote 0
Depending on what exactly you are doing, you may need to separate the names into a separate query/table and unpivot them there, with a key to link them back to the original data
and use the Date as relation between the seperate tables...
Thanks
 
Upvote 0
OK, so create a query that just extracts the columns that were in your original post, then unpivot it as I said before.
 
Upvote 0
Solution
Note: depending on how you are using it, you may want to just keep that as a separate query and not link it to the other data, as you will end up with multiple lines for each item if you link them.
 
Upvote 0

Forum statistics

Threads
1,223,239
Messages
6,170,947
Members
452,368
Latest member
jayp2104

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top