最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

dax - PowerBI : Total is correct but rows are missing in some month - Stack Overflow

programmeradmin3浏览0评论

I've created a matrix table calculated from 3 tables and a Date Table. These tables are TimeRecord, EmployeeSalary and InternalExpense. The datasoureces are MS excel.

  1. TimeRecored -> This table contains employee time tracking for each task, contains Column ID,Name, Date, Task, ProjectCode,Time(decimal).
  2. EmployeeSalary -> This table record salary of each employee in each month.
  3. InternalExpense -> This table record expenses with company in each month.

After created for ID and Date relationship in those model. I've create some measure to summary each Project Cost by Employee's salary x the ratio of time each employee spend on each project and this time ratio also calculate with total monthly expense to distribute this cost in the projects cost. Here are my measures.

1. TimeRatio = DIVIDE(
                       SUM('TimeRecord'[Time]),
                       CALCULATE(SUM('TimeRecord'[Time]),
                                ALL('TimeTracking'[Project])
                                )
                          )
  1. SalaryXWorkRatio = ([WorkingRatio]*SELECTEDVALUE(Salary[Salary]))
  2. ALLExpense = SUM(Expense[Cost])
  3. ProjectExpense = [AllExpense]*[WorkingRatio]
SumSalaryWorkRatio = SUMX(VALUES(Clockify[Project]),
       CALCULATE(SUMX(VALUES(Clockify[Code]),[SalaryXWorkRatio])))
  1. ProjectTotalCost = [SumSalaryWorkRatio]+[ProjectExpense]

Here's my expected result. enter image description here

But its work for some months, when i filter cost in Jan, Mar, May, Aug, Oct. The Expense column not show any value in rows but show correct value in total. like this. while the Total cost column missing calculation with expense cost too. enter image description here

What should i do? I guess it was my measure that not specific some condition in detail. But I still don't understand why the value missing in some months. Could you please suggest me if i need to revised my measure, change it or check anything . Thank you.

I've created a matrix table calculated from 3 tables and a Date Table. These tables are TimeRecord, EmployeeSalary and InternalExpense. The datasoureces are MS excel.

  1. TimeRecored -> This table contains employee time tracking for each task, contains Column ID,Name, Date, Task, ProjectCode,Time(decimal).
  2. EmployeeSalary -> This table record salary of each employee in each month.
  3. InternalExpense -> This table record expenses with company in each month.

After created for ID and Date relationship in those model. I've create some measure to summary each Project Cost by Employee's salary x the ratio of time each employee spend on each project and this time ratio also calculate with total monthly expense to distribute this cost in the projects cost. Here are my measures.

1. TimeRatio = DIVIDE(
                       SUM('TimeRecord'[Time]),
                       CALCULATE(SUM('TimeRecord'[Time]),
                                ALL('TimeTracking'[Project])
                                )
                          )
  1. SalaryXWorkRatio = ([WorkingRatio]*SELECTEDVALUE(Salary[Salary]))
  2. ALLExpense = SUM(Expense[Cost])
  3. ProjectExpense = [AllExpense]*[WorkingRatio]
SumSalaryWorkRatio = SUMX(VALUES(Clockify[Project]),
       CALCULATE(SUMX(VALUES(Clockify[Code]),[SalaryXWorkRatio])))
  1. ProjectTotalCost = [SumSalaryWorkRatio]+[ProjectExpense]

Here's my expected result. enter image description here

But its work for some months, when i filter cost in Jan, Mar, May, Aug, Oct. The Expense column not show any value in rows but show correct value in total. like this. while the Total cost column missing calculation with expense cost too. enter image description here

What should i do? I guess it was my measure that not specific some condition in detail. But I still don't understand why the value missing in some months. Could you please suggest me if i need to revised my measure, change it or check anything . Thank you.

Share Improve this question asked Mar 17 at 7:20 FebbFebb 12 bronze badges 0
Add a comment  | 

1 Answer 1

Reset to default 0

I already fixed this problem. It's due to my tables relationship between TimeRecord[Date] and Datetable[Date] (Many to one). This relationship cross-filter direction was "Single". So i managed relationship in the tables and change this to "Both-way". Then my table back to normal as i expected.

发布评论

评论列表(0)

  1. 暂无评论