Forum Discussion

mco_jr's avatar
mco_jr
Frequent Visitor
2 years ago
Solved

Measure not respecting data segmentation

Hi everyone, currently I'm trying to see every indicator that doesn't have any justification text at the last table below. But everytime that I add a table to my report and try to add a measure that...
  • Anonymous's avatar
    Anonymous
    2 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.