Forum Discussion
gaiusgw
Helper III
5 years agoIdentify matching results
Not sure how to go about this... Sometimes I need to know when customers have ordered the same items so I can let the customers know and avoid a conflict. I would like to be able to choose ...
- 5 years ago
Hi gaiusgw ,
Measure change to this:
test = IF(CALCULATE(DISTINCTCOUNT('CUSTMAST'[CUSTNAME]),FILTER(ALLSELECTED('OPENDET'),'OPENDET'[Color]=MAX('OPENDET'[Color])&&'OPENDET'[Style]=MAX('OPENDET'[Style])))>=2,"#FF0000","#000000")before chage:
after chage:
Best Regards
Lucien
FrankAT
Community Champion
5 years agoHi gaiusgw ,
you can do it with your sample data in Power Query like this:
// Table
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("lZTJboMwEIZfJeIMknebI1vUxQkoIYeK5hApHCpVPVRqn79jIMFQMOGAZaT5/tldVZ6u68/L5v0HISI2+vJbf13rb8/34leMhOTmBh8mcBCqvLNfedn1o24sCi6kMDcdJNEuj/Y7+GHK2PuYkcZ4Vr8E/ZB2+hTBIdEjCBsgii4gfOyECzuJJFWYGclE97HzEE/a5BM2c56HUOMa+4i7w71Dx3wFtC0wom2WQRE9H3X2Ns7WwUKBwikU+5TQQRk0+JG49QPtPh36alAlbdM0U5hgw1gTIaQ7jyHUxQAex8LMjFy6XyNcdMp2LwjmQ+WyM4qDMu3FFXVX8B83kp/jtpoQFtqTCVWU0s2U0AEu6ciZYIO9BKvbXlqZhDJ0aj/BchHK7YCYcqfeI/24PsIISNNywxmyw3+BZjHz3MSHoLD6sFCbMXZrw8IzdMfWU7R9+SysWZjzHw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [CUSTNAME = _t, Style = _t, Color = _t, Quantity = _t, #"Current Sales" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"CUSTNAME", type text}, {"Style", type text}, {"Color", type text}, {"Quantity", Int64.Type}, {"Current Sales", type number}}),
#"Merged Columns" = Table.CombineColumns(#"Changed Type",{"Style", "Color"},Combiner.CombineTextByDelimiter("#", QuoteStyle.None),"Merged"),
#"Grouped Rows" = Table.Group(#"Merged Columns", {"Merged"}, {{"Grouping", each _, type table [CUSTNAME=nullable text, Merged=text, Quantity=nullable number, Current Sales=nullable number]}}),
#"Added Custom" = Table.AddColumn(#"Grouped Rows", "Count Rows", each Table.RowCount([Grouping])),
#"Filtered Rows1" = Table.SelectRows(#"Added Custom", each ([Count Rows] = 2)),
#"Removed Columns" = Table.RemoveColumns(#"Filtered Rows1",{"Count Rows"}),
#"Expanded Grouping" = Table.ExpandTableColumn(#"Removed Columns", "Grouping", {"CUSTNAME", "Merged", "Quantity", "Current Sales"}, {"CUSTNAME", "Merged.1", "Quantity", "Current Sales"}),
#"Removed Columns1" = Table.RemoveColumns(#"Expanded Grouping",{"Merged"}),
#"Split Column by Delimiter" = Table.SplitColumn(#"Removed Columns1", "Merged.1", Splitter.SplitTextByDelimiter("#", QuoteStyle.Csv), {"Style", "Color"})
in
#"Split Column by Delimiter"
With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)
gaiusgw
Helper III
5 years agoThanks FrankAT. But I am not quite sure how to plug this in... I do not want to adjust the source tables because they are being used by other visuals.
Here are the sources:
CUSTMAST[CUSTNAME]
OPENDET[STYLE]
OPENDET[COLOR]
OPENDET[ORIG_QTY]
Your solutions involes creating a new table correct?