Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

New table overview present data using slicer

Hi!   Hopefully someone can help me with the following question.   In my dashboard I use a slicer with different attributes from Table 1. I want to know whether or not these attributes are presen...
  • Anonymous's avatar
    Anonymous
    6 years ago

    HI Anonymous,

    I'd like to suggest you enter to 'query editor' to add a blank table that collection other queries' name and structure, then you can simply write a measure formula to compare current table name and attribute names.

    let
        Source = #table(type table[#"Table Name"=text,#"Column Name"=list],{{"Table1",Table.ColumnNames(Table1)}},{"Table2",Table.ColumnNames(Table2)}},{"Table3",Table.ColumnNames(Table3)}},{"Table4",Table.ColumnNames(Table4)}},
    {"Table5",Table.ColumnNames(Table5)}}),
        #"Expanded column name" = Table.ExpandListColumn(Source, "Column Name")
    in
        #"Expanded column name"

    Measure formula:

    Measure =
    VAR attributeList =
        CALCULATETABLE (
            VALUES ( 'Collection'[Column Name] ),
            ALLSELECTED ( 'Collection' ),
            VALUES ( 'Collection'[Table Name] )
        )
    RETURN
        IF ( SELECTEDVALUE ( 'Selector'[Attribute] ) IN attributeList, "Y", "N" )
    

    Notice: Collection means the table that stored table name and column name, selector means table that used as the source of slicer.

    Regards,

    Xiaoxin Sheng