Forum Discussion

PRADEEPJAAN's avatar
PRADEEPJAAN
New Member
1 year ago
Solved

RATING WISE EMPLOYEE COUNT

Hii Guys,
       I have one challange in my project.I want emp Rating wise emp count. If am select rating 1 in slicer i want to show in  card that show emp count of rating 1 employees.
Here is the sample data

EMP CODERATING

1001

1
10022
10031
10045
10053
10062
10074
10085
10091
10104
10113
  • Hi PRADEEPJAAN,

    You can achieve this by creating a DAX measure that counts the number of employees based on the selected rating in the slicer.

    Solution: Create a Measure

    Use the following DAX formula:

    Emp Count by Rating = 
    VAR SelectedRating = SELECTEDVALUE('Table'[RATING])
    RETURN
    CALCULATE(
    COUNT('Table'[EMP CODE]),
    'Table'[RATING] = SelectedRating
    )

    Steps to Implement:

    1. Load your data into Power BI.
    2. Create a slicer using the RATING column.
    3. Create a card visual and apply the Emp Count by Rating measure.
    4. Now, when you select a rating in the slicer, the card will show the count of employees with that rating.

    Expected Output:

    • Selecting Rating = 1 in the slicer โ†’ The card will show 3 (employees: 1001, 1003, 1009).
    • Selecting Rating = 2 โ†’ The card will show 2 (employees: 1002, 1006).
    • And so onโ€ฆ

    ๐ŸŒŸ I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
    ๐Ÿ’ก Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
    ๐ŸŽ– As a proud SuperUser and Microsoft Partner, weโ€™re here to empower your data journey and the Power BI Community at large.
    ๐Ÿ”— Curious to explore more? [Discover here].
    Letโ€™s keep building smarter solutions together!

2 Replies

  • Hi PRADEEPJAAN,

    You can achieve this by creating a DAX measure that counts the number of employees based on the selected rating in the slicer.

    Solution: Create a Measure

    Use the following DAX formula:

    Emp Count by Rating = 
    VAR SelectedRating = SELECTEDVALUE('Table'[RATING])
    RETURN
    CALCULATE(
    COUNT('Table'[EMP CODE]),
    'Table'[RATING] = SelectedRating
    )

    Steps to Implement:

    1. Load your data into Power BI.
    2. Create a slicer using the RATING column.
    3. Create a card visual and apply the Emp Count by Rating measure.
    4. Now, when you select a rating in the slicer, the card will show the count of employees with that rating.

    Expected Output:

    • Selecting Rating = 1 in the slicer โ†’ The card will show 3 (employees: 1001, 1003, 1009).
    • Selecting Rating = 2 โ†’ The card will show 2 (employees: 1002, 1006).
    • And so onโ€ฆ

    ๐ŸŒŸ I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
    ๐Ÿ’ก Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
    ๐ŸŽ– As a proud SuperUser and Microsoft Partner, weโ€™re here to empower your data journey and the Power BI Community at large.
    ๐Ÿ”— Curious to explore more? [Discover here].
    Letโ€™s keep building smarter solutions together!

  • pradeepnani's avatar
    pradeepnani
    Frequent Visitor

    Hi, 
    to achieve the rating wise count you can use this measure 

    Rating Wise count=
    var select=selectedvalue(tablename[rating])
    var result=If(select,calculate(tablename[employee code]))
    return
    result