Forum Discussion

costing's avatar
costing
Frequent Visitor
2 years ago
Solved

Slice using different column from the one bound to an M query parameter

I have a slicer (single select) on a date column in this slicer table:   date table_name Monday table_01 Tuesday table_02 Wednesday table_03   The table_name column is bound to...
  • costing's avatar
    2 years ago

    Hey danextian , thank you for the conversation. 

    I've found a way to do it.  The steps are:
    - bind date column to a parameter date_parameter (instead of table_name.)

    - in power query, look up table_name in the let statement before loading the table.

     

    Here's the code, where SLICER_TABLE refers to

    datetable_name
    Mondaytable_01
    Tuesdaytable_02
    Wednesdaytable_03

     

     

    let
        my_date = Text.From(date_parameter),
        my_table = List.First(
            Table.Column(
                Table.SelectRows(SLICER_TABLE, each [DATE] = my_date)
                , "TABLE_NAME"
            )
        ),
        .... (then use my_table as the table to load)

     

     
    I'm new to mashup, so if there's a more elegant way, please let me know.