Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi,
I have a table of multiple columns that I will like to display showing all possible combinations of those values. Does anyone has an easy solution? Below a simple example of what I am trying to resolve. Thank you.
Solved! Go to Solution.
Hi @Aleph18
Create a new table, where Table1 is the original table you show on the left:
NewTable =
VAR AuxTable_ =
CROSSJOIN ( DISTINCT ( Table1[Product] ); DISTINCT ( Table1[Type] ) )
RETURN
ADDCOLUMNS (
AuxTable_;
"Quantity"; LOOKUPVALUE (
Table1[Quantity];
Table1[Product]; [Product];
Table1[Type]; [Type]
)
)
You can use this DAX, though I always prefer to do this type of thing in Power Query:
Table 2 =
ADDCOLUMNS(
CROSSJOIN(
SELECTCOLUMNS('Table', "Type",'Table'[Type]),
SELECTCOLUMNS('Table',"Product",'Table'[Product]
)
),
"Quantity", CALCULATE( SUM( 'Table'[Qty])))
You can use this DAX, though I always prefer to do this type of thing in Power Query:
Table 2 =
ADDCOLUMNS(
CROSSJOIN(
SELECTCOLUMNS('Table', "Type",'Table'[Type]),
SELECTCOLUMNS('Table',"Product",'Table'[Product]
)
),
"Quantity", CALCULATE( SUM( 'Table'[Qty])))
Hi @Aleph18
Create a new table, where Table1 is the original table you show on the left:
NewTable =
VAR AuxTable_ =
CROSSJOIN ( DISTINCT ( Table1[Product] ); DISTINCT ( Table1[Type] ) )
RETURN
ADDCOLUMNS (
AuxTable_;
"Quantity"; LOOKUPVALUE (
Table1[Quantity];
Table1[Product]; [Product];
Table1[Type]; [Type]
)
)
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 46 | |
| 43 | |
| 39 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 68 | |
| 67 | |
| 31 | |
| 27 | |
| 24 |