Forum Discussion
Measure not respecting data segmentation
- Anonymous2 years ago
Hi mco_jr ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) Click "transform data" to enter the power query, create two new tables, open the "Advanced Editor" copy and paste the following code.
let Source = Table.NestedJoin(#"Indicator table", {"ID"}, #"Offshoot Table", {"ID"}, "Offshoot Table", JoinKind.LeftOuter), #"Expanded Offshoot Table" = Table.ExpandTableColumn(Source, "Offshoot Table", {" Offshoot", " Section"}, {"Offshoot Table. Offshoot", "Offshoot Table. Section"}) in #"Expanded Offshoot Table"let Source = Table.NestedJoin(Merge1, {"Offshoot Table. Offshoot"}, #"Justification table", {"Offshoot"}, "Justification table", JoinKind.LeftOuter), #"Expanded Justification table" = Table.ExpandTableColumn(Source, "Justification table", {" JustificationText"}, {"Justification table. JustificationText"}), #"Renamed Columns" = Table.RenameColumns(#"Expanded Justification table",{{"Offshoot Table. Section", "Section"}}), #"Removed Columns" = Table.RemoveColumns(#"Renamed Columns",{"ID", "Offshoot Table. Offshoot"}), #"Renamed Columns1" = Table.RenameColumns(#"Removed Columns",{{"Justification table. JustificationText", "JustificationText"}}), #"Replaced Value" = Table.ReplaceValue(#"Renamed Columns1"," ",null,Replacer.ReplaceValue,{"JustificationText"}) in #"Replaced Value"(3) We can create a measure.
AnaliseCritica = IF(ISBLANK(MAX('Merge2'[JustificationText])),"","x")(4) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi mco_jr ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) Click "transform data" to enter the power query, create two new tables, open the "Advanced Editor" copy and paste the following code.
let
Source = Table.NestedJoin(#"Indicator table", {"ID"}, #"Offshoot Table", {"ID"}, "Offshoot Table", JoinKind.LeftOuter),
#"Expanded Offshoot Table" = Table.ExpandTableColumn(Source, "Offshoot Table", {" Offshoot", " Section"}, {"Offshoot Table. Offshoot", "Offshoot Table. Section"})
in
#"Expanded Offshoot Table"let
Source = Table.NestedJoin(Merge1, {"Offshoot Table. Offshoot"}, #"Justification table", {"Offshoot"}, "Justification table", JoinKind.LeftOuter),
#"Expanded Justification table" = Table.ExpandTableColumn(Source, "Justification table", {" JustificationText"}, {"Justification table. JustificationText"}),
#"Renamed Columns" = Table.RenameColumns(#"Expanded Justification table",{{"Offshoot Table. Section", "Section"}}),
#"Removed Columns" = Table.RemoveColumns(#"Renamed Columns",{"ID", "Offshoot Table. Offshoot"}),
#"Renamed Columns1" = Table.RenameColumns(#"Removed Columns",{{"Justification table. JustificationText", "JustificationText"}}),
#"Replaced Value" = Table.ReplaceValue(#"Renamed Columns1"," ",null,Replacer.ReplaceValue,{"JustificationText"})
in
#"Replaced Value"
(3) We can create a measure.
AnaliseCritica = IF(ISBLANK(MAX('Merge2'[JustificationText])),"","x")
(4) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you!
I was trying not to merge them(more than a million rows), but I guess that I don't have any other option