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 I'm using to check if the indicator is blank or not , the table just shows every indicator possible, not respecting the data segmentation that I have in my report.

 

Indicator table:

ID Indicator
1 A
2 B
3 C
4 D


Offshoot Table:

ID Offshoot Section
1 11 Q
1 12 W
2 2 Q
3 31 E
3 32 R
4 41 Q
4 42 W


Justification table:

Offshoot Date JustificationText
11 01/01/2024 ASD
12 01/01/2024 
2 01/01/2024 
32 01/01/2024 QWE
41 01/01/2024 ZXC
42 01/02/2024 



I'm currently using this measure:

 

AnaliseCritica =
IF(ISBLANK(MAX('Justification'[JustificationText])), "","x")
 
I'm using 2 segmentation datas, one for section other for month, but everytime that I add this measure in my table, he just ignore those segmentations (it didn't happen when I just don't use this measure)
My table always show this kind of result:

Indicator Section AnaliseCritica
A Q x
A W 
B Q 
C E 
C R x
D Q x
D W 

 

If my section was filtered to Q, it should be like that:

Indicator Section AnaliseCritica
A Q x
B Q 
D Q x
  • 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. 

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    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. 

    • mco_jr's avatar
      mco_jr
      Frequent Visitor

      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