Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
item
salesConsider the following problem: we have two tables: item and sales. Id is a primary key. Suppose we sell last item with some discount (we know nothing about this discount).
We want to add the column with the price of the last sold item to the table item.
We are using something like this:
Last_price=
Var
table_variable=FILTER(RELATEDTABLE(Sales);Sales[discount]=1)
Return
table_variable[price]
It is not working. But is there a way to return the column using column of the table variable?
HI @Diligent_
Does the discount signify it is the last item? If not how do you know it is the last item?
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
Proud to be a Super User!
We have a discount only if the last item left. In case of item fancy shoes we have a 50 % discount ( it could be 40% or 60% we have no information on the value of the discount)
The example stated is Just a problem to illistrate the question of how to reffer to the column of a table variable.
Hi @Diligent_
Would you provide us with a picture of expected output?
Thanks,
Nathaniel
Proud to be a Super User!
This is the result I want to obtain
I am trying to create a new column in the table items with these values inserted.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
8 | |
8 | |
8 | |
6 |
User | Count |
---|---|
14 | |
12 | |
11 | |
9 | |
9 |