Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
hey,
I am trying to calculate total number of employees in the last of row in visual what steps should i follow? Please help me to get rid of this.
Solved! Go to Solution.
Hi @Kabeerkhan007
You can add the Employee Name Column as a measure:
Employee Name Measure =
IF (
HASONEVALUE ( TableName[EmpID0 ), SELECTEDVALUE ( TableName[Employee Name] ),
COUNTROWS ( TableName )
)
how many tables do you have. please check the relationships if you are connecting 2 tables.
Incase you have duplicate ID's in the table you csn use the following measure instead of the column [Employee Name] and you shall get the nimber of employees at the bottom as requested
Employee Name Measure =
IF (
HASONEVALUE ( TableName[EmpID] ), SELECTEDVALUE ( TableName[Employee Name] ),
DISTINCTCOUNT ( TableName[EmpID] )
)
@tamerj1 Still has the same visual. There is no duplicity for the count, I don't want that column to be seen in the table, but I only want the total count.
I totally understand your requirement right from the beginning. The measure I proposed should return the name in all row except in the total where you should see the total count. I see no reason it shouldn't work! Would please help me out with a screenshot?
Hi @Kabeerkhan007
You can add the Employee Name Column as a measure:
Employee Name Measure =
IF (
HASONEVALUE ( TableName[EmpID0 ), SELECTEDVALUE ( TableName[Employee Name] ),
COUNTROWS ( TableName )
)
You have 2 options,
1. You can simply drag and drop EmpID in a card visual value field, and change summarization to Count
2. OR you can make a new measure :
@MajeedKhan Hey thanks for the suggestion. I already have card visual in my main page, I was trying to show in another visual with the help of emp id or name.
I tried your 2 option but its look like this total value is correct but in every column it is showing 1.
@tamerj1 Yes, i tried but it's visual are same as @MajeedKhan said. It is showing 1 in all column, Which i don't want in my table.
The must be something wrong. Would you please share a screenshot of the code along with the result?
@tamerj1 I just want total number of employee in the last row of table without creating any other column. Is there any method to do with emp id or emp name?
The closing bracket of HASONEVALUE is missing. Please fix it snd try it in your table. Then you can take the Employee Name column out of the table.
Thankyou so much, Now it works absolute perfect..
Hey @Kabeerkhan007 ,
You have two options here, either have a column with datatype as whole number that can be summed to show the total or have a separate measure like Countofemployees = Count(EmpID) and show it in a card viusal separately.
@PC2790 Hey thanks for the help
Datatype is already in the whole number and I tried your second option it work and showed me the correct value but it is showing 1 in all rows.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
67 | |
60 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |