Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
I am working on a reporting page for my company's internal on-boarding process. For this particular page, I would like the user to select an employee (via a slicer) and display all the on-boarding tasks assigned to that employee.Context on the data: There are three tables in the backend. The table 'Master Task List Admin' contains all the tasks that are a part of the on-boarding process, along with a 'TaskID' column that serves as an identifier. The table 'New Hires' lists all the new employees, along with their emails (which serves as the identifier). The table 'Emp Assigned Tasks' is essentially the "sumproduct" of the two aforementioned tables; whenever a new employee is added to the 'New Hires' table, the contents of 'Master Task List Admin' are duplicated along with the new employee's information from 'New Hires' and appended to the bottom of the 'Emp Assigned Tasks.'
I then created a fourth table called "NumCompletedTasks' within Power BI to calculate the number of outstanding and total tasks along with a calculated column for the completion percentage for each employee (one for each row). The code for the table is:
NumCompletedTasks = GROUPBY('Emp Assigned Tasks', 'Emp Assigned Tasks'[Full_Name_String], 'Emp Assigned Tasks'[Email_OnboardingApp], "Number of Completed Tasks", COUNTX( CURRENTGROUP(), IF('Emp Assigned Tasks'[TaskCompleted]="TRUE",'Emp Assigned Tasks'[TaskCompleted],BLANK())), "Number of Total Tasks", COUNTAX( CURRENTGROUP(),'Emp Assigned Tasks'[TaskCompleted]) )
And the code for the calcualted column is:
PercentCompleted = IF(NumCompletedTasks[Number of Completed Tasks] = 0, 0, DIVIDE(NumCompletedTasks[Number of Completed Tasks],NumCompletedTasks[Number of Total Tasks]))
Just as I have a card visual displaying the employee's name, I would like to create a card that displays his/her percentage of completed tasks. However, I can't display the percentage value as something other than a summarization function (i.e. min/max, avg) for the entire percentage column. I have already set the column to "Don't summarize" within 'Modeling'.
Should I be creating a measure to work around this? Is there a way to sync that name slicer to a filter applied to the card visual? Or something else I'm not thinking of? Appreciate any and all help.
Hi @Anonymous ,
Values in the visual are always aggregated, so you really need to create a measure to achieve the effect you want. You can try the measure below:
PercentCompleted = IF ( SUM ( NumCompletedTasks[Number of Completed Tasks] ) = 0, 0, DIVIDE ( SUM ( NumCompletedTasks[Number of Completed Tasks] ), SUM ( NumCompletedTasks[Number of Total Tasks] ) ) )
If it doesn't work, sample data and expected output would help tremendously.
Best Regards,
Community Support Team _ Joey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
115 | |
112 | |
105 | |
95 | |
58 |
User | Count |
---|---|
174 | |
147 | |
136 | |
102 | |
82 |