Forum Discussion
Create a visual with data from various tables
- 3 years ago
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 OKPete
You were super clear and you even gave me the exercise. Amazing!
Pete, thank you so much.