Forum Discussion

jcastr02's avatar
jcastr02
Icon for Post Prodigy rankPost Prodigy
1 year ago
Solved

Creating matrix

I'm trying to create a matrix counting how many unique Recieving store numbers fall into different categories of their new volume (Base + Retained).  For each closing store - there will be a recievin...
  • bhanu_gautam's avatar
    1 year ago

    jcastr02 , Create a new table to calculate the total retained sales and new volume for each receiving store:

    AggregatedData =
    SUMMARIZE(
    'YourTable',
    'YourTable'[Receiving Store],
    "TotalBaseSales", MAX('YourTable'[Base Sales]),
    "TotalRetainedSales", SUM('YourTable'[Retained Sales]),
    "NewVolume", MAX('YourTable'[Base Sales]) + SUM('YourTable'[Retained Sales])
    )

     

    Create calculated columns to categorize the new volume and retained sales:

    NewVolumeCategory =
    SWITCH(
    TRUE(),
    [NewVolume] <= 200, "0-200",
    [NewVolume] <= 350, "201-350",
    "351+"
    )

    RetainedSalesCategory =
    SWITCH(
    TRUE(),
    [TotalRetainedSales] <= 30, "0-30",
    [TotalRetainedSales] <= 150, "30-150",
    "150+"
    )

     

    Insert a Matrix Visual in Power BI.

    Add Rows and Columns:

    Drag RetainedSalesCategory to the Rows.
    Drag NewVolumeCategory to the Columns.
    Add Values:

    Drag Receiving Store to the Values and set the aggregation to Count (Distinct).