Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Help with Data Modelling and Slicers

Hi Community Members,   Please help me with a solution to this problem.   I have the following Data    Customer NameModelsSectorOps LeadGo-LIVE DateModel Type Framework A Mod...
  • BA_Pete's avatar
    BA_Pete
    5 years ago

    Anonymous ,

     

    Yeah, the duplication thing isn't good with that idea.

     

    How about this:

    Create a table with all the unique person values [opsLeadName] in, let's say it's called dimOpsLead. Keep this UNRELATED from your main table.

     

    Use the dimOpsLead[opsLeadName] field in your slicer, then on the page/visuals you want to slice by the Ops Lead, you could use this measure as a filter:

     

    opsLeadExists =
    SEARCH(
        SELECTEDVALUE(dimOpsLead[opsLeadName]),
        SELECTEDVALUE(yourTable[Ops Lead]),
        ,-1
    )

     

     

    Set the filter to be [opsLeadExists] >= 1.

     

    Pete 

  • BA_Pete's avatar
    BA_Pete
    5 years ago

    Anonymous ,

     

    In Power Query, I would create a new query something like this:

    let
        Source = Table.SelectColumns(yourTable, "Ops Lead"),
        #"Split Column by Delimiter" = Table.SplitColumn(Source, "Ops Lead", Splitter.SplitTextByDelimiter(" / ", QuoteStyle.Csv), {"OpsLeadTemp1", "OpsLeadTemp2"}),
        #"Added Custom" = Table.AddColumn(#"Split Column by Delimiter", "OpsLeadList", each {[OpsLeadTemp1], [OpsLeadTemp2]}),
        #"Expanded OpsLeadList" = Table.ExpandListColumn(#"Added Custom", "OpsLeadList"),
        #"Filtered Rows" = Table.SelectRows(#"Expanded OpsLeadList", each ([OpsLeadList] <> null)),
        distinctList = Table.Distinct(Table.SelectColumns(#"Filtered Rows", "OpsLeadList"))
    in
        distinctList

     

    This will dynamically create a distinct list of all the people featured in your original [Ops Lead] field, using the same technique as my first answer (I knew it would come in useful somehow!).

     

    Also, it looks lke you've accidentally accepted your own answer as the solution on this post, rather than mine.

     

    Pete