Forum Discussion
Help with Data Modelling and Slicers
- 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
- 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 distinctListThis 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
Hey BA_Pete ,
Thank You so much for the reply.
The issue which I see in my situation is that the dataset is quite huge and I also haves similar situation for some other columns too (Batch Time , Batch Size) .
As stated by you this introduces duplicates in my table which I want to avoid.
Is there any other way to acheive this?
Regards,
HN
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
- Anonymous5 years agoNot applicable
Hi BA_Pete ,
Thanks. I will give this a try.
Also, one more help , how do I use the source data to create this table. Can this be done with the help of Power Query/DAX.
Or do I need to create them manually and keep updating it once a new user is added.
Thanks,
HN
- BA_Pete5 years agoSuper User
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 distinctListThis 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
- Anonymous5 years agoNot applicable
Hi BA_Pete ,
Thanks for pointing this out.
The new layout is very confusing. Will mark your solution as the correct one.
Thanks
HN