Forum Discussion

PBInewbee123's avatar
PBInewbee123
Frequent Visitor
3 years ago
Solved

show different values depending on filter, but keep empty rows

Hi, 
I need some help with the following:
I have a dataset which contains a BOM and a master file.
BOM: list of materials with their components

Master: list of components per location


What I now want to do is to have the full BOM visible in a table, but I want to add an extra column (measure??) which indicates whether this component is already existing in a certain location. So this depends on who is looking at the report. this then comes from the Master. If the component does not exist in that location, I still want to have the component visible in the table, but with indication 'No' in that extra column. Indication "Yes" if the component does exist.

So for example:

Material A consists of components X, Y and Z. For location Brussels, component X already exists in their location, component Y and Z not. But for location Paris, all 3 components already exist.
If I am viewing the report as location Brussels, I still want to see that material A consists of X, Y and Z, but in the extra column, I want to see 'Yes' (or whatsoever) to indicate that A already exists, while the values is in the rows for component Y and Z should be empty or 'No'
Example for location Brussels

MaterialComponentAlready exists?
AXYes
AYNo
AZNo

 

Example for location Paris

MaterialComponentAlready exist?
AXYes
AYYes
AZYes

I don't want different columns per location. I want 1 column, which shows me different values, depending on which location is viewing the report (defined by RLS or filtering).



  • Hi PBInewbee123 ,

    According to your description, here's my solution.

    Sample:

    BOM table:

    Master table:

    Create a measure:

    Already Exist =
    IF (
        COUNTROWS (
            FILTER (
                ALLSELECTED ( 'Master' ),
                'Master'[Component] = MAX ( 'BOM'[Component] )
            )
        ) > 0,
        "Yes",
        "No"
    )
    

    Put Location column in slicer, get the result:

    I attach my sample below for your reference.

     

    Best regards,

    Community Support Team_yanjiang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

2 Replies

  • Hi PBInewbee123 ,

    According to your description, here's my solution.

    Sample:

    BOM table:

    Master table:

    Create a measure:

    Already Exist =
    IF (
        COUNTROWS (
            FILTER (
                ALLSELECTED ( 'Master' ),
                'Master'[Component] = MAX ( 'BOM'[Component] )
            )
        ) > 0,
        "Yes",
        "No"
    )
    

    Put Location column in slicer, get the result:

    I attach my sample below for your reference.

     

    Best regards,

    Community Support Team_yanjiang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.