PivotValues1 =
VAR ALLS =
SELECTCOLUMNS (
ADDCOLUMNS (
ALLNOBLANKROW ( Dim_product[ProductID] ),
"Rank", 1,
"Segmentation", "Total"
),
"Segmentation", [Segmentation],
"PDC Key", Dim_product[ProductID],
"Selection", "Total",
"Rank", [Rank],
"Dimension", 1
)
VAR Manufacturer =
SELECTCOLUMNS (
ADDCOLUMNS (
ALLNOBLANKROW ( Dim_product[ProductID], Dim_product[Manufacturer] ),
"Rank", 2,
"Segmentation", "Manufacturer"
),
"Segmentation", [Segmentation],
"PDC Key", Dim_product[ProductID],
"Selection", Dim_product[Manufacturer],
"Rank", [Rank],
"Dimension", 1
)
VAR Segment =
SELECTCOLUMNS (
ADDCOLUMNS (
ALLNOBLANKROW ( Dim_product[ProductID], Dim_product[Segment] ),
"Rank", 3,
"Segmentation", "Segment"
),
"Segmentation", [Segmentation],
"PDC Key", Dim_product[ProductID],
"Selection", Dim_product[Segment],
"Rank", [Rank],
"Dimension", 1
)
VAR Country =
SELECTCOLUMNS (
ADDCOLUMNS (
ALLNOBLANKROW ( Dim_geo[Zip], Dim_geo[Country] ),
"Rank", 4,
"Segmentation", "Country"
),
"Segmentation", [Segmentation],
"PDC Key", Dim_geo[Zip],
"Selection", Dim_geo[Country],
"Rank", [Rank],
"Dimension", 2
)
RETURN
UNION ( ALLS, Manufacturer, Segment, Country )