Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Create New Table Displaying Unique Values From EACH Column - ignoring row relationships

I am trying to create a slicer that works across all datasets - these datasets are ever changing so I need a seperate table which generates unique values on refresh within Power Query - whilst ignori...
  • BA_Pete's avatar
    4 years ago

    Hi Anonymous ,

     

    It sounds like you need to create dimension tables for each of the dimensions that you want to slice on.

    You can create these dynamically in Power Query by using the following code in a new blank query:

    let
        Source = Table.Distinct(Table.SelectColumns(inputTable, "Manufacturing Plant"))
    in
        Source

     

    Do this for each of the columns that you want to be able to slice against, apply all the tables to your data model, then relate dimensionTable[columnName] to factTable[sameColumnName] on a 1:MANY basis.

    Use the dimension table column in any filters/slicers and it will correctly filter your fact table.

     

    The principle you are looking for is STAR SCHEMA, and more info can be read here:

    https://docs.microsoft.com/en-us/power-bi/guidance/star-schema 

     

    Pete