Forum Discussion
Compare multiple values against target budget
- Anonymous3 years ago
Hi pagliaci ,
According to the code, I think you don't need to create a relationship between target table and expense table. We have added the filter in code.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi pagliaci ,
If your "Expense" table is as below, you can try to Unpivot [Target for Month] columns in "Targer" table in Power Query Editor.
New Table:
Then your calculation will be much easier.
M_Expense =
CALCULATE(SUM(Expense[Expense]),FILTER(ALL(Expense),Expense[Department] = MAX(Target[Department])&& Expense[Month] in VALUES(Target[Month]))) Measure = IF([M_Expense]> SUM(Target[Target]),"Yes","No")Result is as below.
Best Regards.
Thank you. What relations should I make? Because I need to filter by department and by date
- Anonymous3 years agoNot applicable
Hi pagliaci ,
According to the code, I think you don't need to create a relationship between target table and expense table. We have added the filter in code.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.