Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Multiple relationships between tables

I've looked online and messed around but still need assistance. I want to maintain my "Store" relationships but also add relationships for "Week.2". I'm using these for filtering however, the filters aren't flowing through for the Weeks at the moment. So I created a separate table with basic weeks (ie 1-52) and try to set it but it doesn't work ("Store" filter works fine):

 

 

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Thanks. I've resolved my issue by creating 2 filters and combing them as a group and selecting "sync slicers"

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Main table Store Directory which I connect all tables (Key):

    Store NumberStore Name
    1Storename1
    4Storename2
    5Storename3
    7Storename4
    13Storename5
    15Storename6
    16Storename7
    22Storename8
    23Storename9


    WK Table, which I've created to allow tables to associate wk numbers with:

    Week
    202201
    202202
    202203
    202204
    202205
    202206
    202207
    202208
    202209
    202210
    202211
    202212
    202213
    202214
    202215
    202216
    202217
    202218
    202219
    202220
    202221
    202222
    202223
    202224
    202225
    202226
    202227
    202228
    202229
    202230
    202231
    202232
    202233
    202234
    202235
    202236
    202237
    202238
    202239
    202240
    202241
    202242
    202243
    202244
    202245
    202246
    202247
    202248
    202249
    202250
    202251
    202252

    Traffic data example:

     

    site_namefiscal week #fiscal monthfiscal yeartraffic
    41Feb202260
    42Feb202220
    43Feb202250
    44Feb202241
    45Mar202260
    46Mar202255
    47Mar202266
    48Mar2022555
    49Mar202229
    410Apr202260
    224Feb202220
    225Mar202250
    226Mar202241
    227Mar202260
    228Mar202255
    221Feb202266
    222Feb2022555
    231Feb202229
    232Feb202260
    233Feb202220
    234Feb202250
    235Mar202241
    236Mar202260
    237Mar202255
    238Mar202266
    239Mar2022555
    2310Apr202229
    2331Sep202260
    2332Sep202220
    2333Sep202250
    2334Sep202241
    2335Sep202260
    583Feb202255
    584Feb202266


    Task table example:

    StoreWeekHours
    120220112
    42022015
    72022016


    Training table example:

    StoreWeekHours
    4742022019
    5302022015
    5302022021
    58620220120
    56820220160
    90872022012


    Stock take table example:

    StoreWeekHours
    12022054
    42022056


    LP table example:

    StoreWeekHours
    55820220136
    55820220236
    55820220336
    55820220436


    Misc table example:

    StoreWeekHours
    52620220110


    Etc etc

     

    Please note within Power BI I have tried both formats of WK entry in all tables to see if either works ie:

    202201
    202202

    And

    20221
    20222


    I want "Week filter" to work for all, currently it only works for 1 active relationship:

    Below is to represent the main table (key) is for the Store name as I need to utilist this for other data (ie store name table):

     

    • lbendlin's avatar
      lbendlin
      Super User

      The 202201  format for the week is preferable.

       

      Power BI would like to see a data model that has dimension tables (things you can filter by)  surrounding fact tables (things you can compute) in a star schema or snowflake schema.  Dimension tables have primary keys that are unique, and that are pointing to fields in the fact table in a 1:* relationship.  Your data model snapshot seems to be lacking these features.  Please consider cleaning your data model up so you can arrive at the star/snowflake schema.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Thanks. I've resolved my issue by creating 2 filters and combing them as a group and selecting "sync slicers"