Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
pagliaci
Frequent Visitor

Compare multiple values against target budget

 Hello, 

 

I have a powerbi where it shows me a report for the total $ spent in the departments, the database is the $ of each product bought, where I have a card that shows me the total amount and a table like this:

pagliaci_0-1659541702540.png

 

And I want to compare that with the target for the month for example:

pagliaci_1-1659541755688.png

 

My final result should be showing if the amount spent is within the target. I am having trouble to do this because my expenses are dynamic and my target is fixed, so when I try to put in a table together it keeps doing the avarage or sum. Does anyone have an idea on how to do it?

 

Thank you

 

 

1 ACCEPTED SOLUTION
Anonymous
Not 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 Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
RicoZhou2
Resolver I
Resolver I

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.

RicoZhou2_1-1660031446955.png

New Table:

RicoZhou2_0-1660031318418.png

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.

RicoZhou2_3-1660031724862.png

 

Best Regards.

 

Thank you. What relations should I make? Because I need to filter by department and by date

Anonymous
Not 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 Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. I cannot help you without meaningful sample data.
Please paste the data into a table in your post or use one of the file services like OneDrive or Google Drive. I cannot use screenshots of your source data.
Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.