Forum Discussion
Table Visual: Total is accurate but Rows Not Showing the Right Data
Hi,
Have Four Tables.. Staff Master for Staff Details. MS Calendar for a Customer Date Calendar, Project Master for Project Details and a Fact Table for time entry which captures the time by date, employee and project.
The Staff Master has a one to many Relationship with the Time Entry Table on the StaffID column. The Project Master has a One to many Relationship with the Time Entry Table on the Project Code Column. The Ms Calendar has a One to many Relationship with the Time Entry Table on the Date Column.
Objective: To calculate the Project Cost based on time entered by an employee in the Time Entry table. Each Employee has their own individual cost rate which is a filed in the Staff Master Table.
The visual has a date slicer where the from date and to date is chosen by the user and the system has a table visual to display the project name, cost, revenue and margin on each project.
Standard Working Hours per day is 7.23 hours. The MS Calendar has a column called Workday which returns a YES or a NO based on whether it is a holiday or a weekend.
The way we do this is:
1) We calculate the Standard Working Hours by Employee for the date period chosen by counting the total working days and multiply it with the standard working hours per day.
2) We calculated the time entered by employee from the Time Entry table for the date rance. This gives us the Total Time Entered.
Cost Calculation: If the Total Time Entered is less than the Standard Working Hours, then individual cost rate from the staff table is multiplied with the total time entered. Whereas if the Total Time Entered is GREATER than the standard working hours, then the calculation is to Divide the Standard Working Hours by the Total time Entered and then multiple this by the Individual cost rate.
Reason is: Salary is a fixed amount per month/hour.. If a staff member who is salaried has worked more hours then the total cost would remain the same across more time being billed, hence the cost per hour on the project would reduce. An employee would/could have billed across multiple projects, hence the reduced cost rate has to be applied to the time across the projects the employee has entered time for the date range.
I have written multiple measures to arrive at the new cost amount.
Problem is:
For an employee who has entered more time than the standard work hours, let us say his cost has reduced from $60 to $55 per hour.
When i have only the employee in the table visual along with the New Cost Rate and the Cost Amount, it shows the right details of $55 per hour
As soon as i include the project code or the project name in the table visual, the row wise information shows only $60 (Individual Cost Rate of the employee) in the rows along with the project information but the TOTAL column shows the correct cost rate of $55. Same happens for the amount.
Why is this? I am more or less a beginner and I am missing something but not able to figure out why it works only when the visual contains the employee name and as soon as i include the project information, only the total is correct and individual row information is the old rate.
Thanks in advance for your help..
Regards
1 Reply
- v-zhangtiCommunity Support
Hi, RajeshPBI
Can you provide sample data for testing? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures or Excel. I look forward to your response.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.