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.
I need to create a table and then with this table, to create another table. But the first table need to be created from a selection.
Tried everything and I just can't go on.
The measure getting the selectedvalue:
Selected = SELECTEDVALUE(dProducts[ProductCode])
The first table attempt :
FilteredBySelectedValue =
Var _ProductCode = [Selected]
Return
ROW( "ProductCode",_ProductCode)
The second table attempt :
fBasketRelated =
FILTER(
CROSSJOIN(
VALUES(FilteredBySelectedValue[ProductCode]),SELECTCOLUMNS( VALUES( fSalesDetails[ProductCode]),"RProductCode",[ProductCode])),[ProductCode]>[RProductCode])
The result : Nowhere.
f1
The model :
Solved! Go to Solution.
I think it depends what you expect to do with the result. If you start constructing a table from a selectedvalue in a filter context then you can use that table in memory and transform it as needed but the final return value needs to be scalar (a count of rows, or a CONCATENATEX of values).
So, if got it right, my final result needs to be a measure, because a table return more than one result.
If so, there is no solution for my needs?
Because I need to create a table :
Table =
FILTER(
CROSSJOIN(
VALUES(FilteredBySelectedValue[ProductCode]),SELECTCOLUMNS( VALUES( fSalesDetails[ProductCode]),"RProductCode",[ProductCode])),[ProductCode]>[RProductCode])
And the first values ("VALUES(FilteredBySelectedValue[ProductCode])") needs to come from a selectedvalue.
your final result type must match the type of the original value.
How do you expect to consume the table that you created out of a scalar value?
I thought that with this code I would create a table with a single row and column(Figure 1), and it seems a scalar result because it is only one of it's kind. Please, note that if I set the value manually (VAR _ProductCodeTyped ) I get the desired value and I can consume the table to generate the second table (figure 2).
Figure 1
And then with the second table I would create columns and measures.
Figure 2
If I got your question right. @lbendlin .
you might get away with a single row/single column table as the final output. But not as an intermediate step to a larger table.
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 |
---|---|
11 | |
9 | |
7 | |
6 | |
5 |
User | Count |
---|---|
20 | |
11 | |
10 | |
9 | |
6 |