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
JessicaVanti
New Member

Create a visual with data from various tables

Hi everyone,

 

I am not too good at explaining things, and I hope the image below can help me convey my issue:

JessicaVanti_1-1683210617001.png

I have a table indicating how much fruit was sold and when. I have another table that tells me how much I should have sold in 2023.

I want to create a table that compares the data and tells me how much fruit is still needed to be sold to reach the target.

 

I'm afraid the solution might be very simple, but I've been trying for days and I still can't get the result I want.

1 ACCEPTED SOLUTION
BiNavPete
Resolver III
Resolver III

Hi @JessicaVanti 

See attached PBIX.
2 fact tables - data and target.
Data is as in your screenshot. Target is unpivoted on Target 2023 column and then that column reoworked to provide a year in each row. Doing it this way will solve future or past targets if you had adjacent columns Target 2022, Target 2024 in the original table.

Create following dimension tables from data:
Years - reference Data table, delete all cols other than year and deduplicate
Fruits - reference Target table and delete all cols other than fruit.

Bring all this lot to Power BI with close and apply.
Create single directional, one to many relationships from fruit table to Data and Target. Ditto for years.

Now we have a model that DAX will like.
Create Measures:
[Qty Sold] = Sum(Data[Qnty Sold])
[Target] = 
sum(Target[Value])
Delta = [Qty Sold] - [Target]

Then bring the columns into a table visual with a year slicer.

Boom!

Link here to PBIX.

Hope you get on OK

Pete

View solution in original post

2 REPLIES 2
JessicaVanti
New Member

You were super clear and you even gave me the exercise. Amazing!

Pete, thank you so much. 

BiNavPete
Resolver III
Resolver III

Hi @JessicaVanti 

See attached PBIX.
2 fact tables - data and target.
Data is as in your screenshot. Target is unpivoted on Target 2023 column and then that column reoworked to provide a year in each row. Doing it this way will solve future or past targets if you had adjacent columns Target 2022, Target 2024 in the original table.

Create following dimension tables from data:
Years - reference Data table, delete all cols other than year and deduplicate
Fruits - reference Target table and delete all cols other than fruit.

Bring all this lot to Power BI with close and apply.
Create single directional, one to many relationships from fruit table to Data and Target. Ditto for years.

Now we have a model that DAX will like.
Create Measures:
[Qty Sold] = Sum(Data[Qnty Sold])
[Target] = 
sum(Target[Value])
Delta = [Qty Sold] - [Target]

Then bring the columns into a table visual with a year slicer.

Boom!

Link here to PBIX.

Hope you get on OK

Pete

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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