Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Table Filter with calculated measure

Hi,

 

I am having a list of columns for agile as features, initiatives, etc. I need to have details in a table and everything works fine with the filters applied for respective teams. But when i use a measure to show the 'planned v2 feature' measure, the filter breaks and i get the entire data in the table. Below is the DAX i'm using.

 

Its a fairly simple expression, where i'm getting the output for count of features with no blank feature states and release names, etc. It works fine as it gives me expected output. But when i filter for a team from the filter pane, or use a slicer, table doesn't get filtered or sliced. Table is filtered as expected without this measure.

 

Feature Plan v2 edit = IF(ISBLANK(CALCULATE(DISTINCTCOUNT('Release Details'[Feature ID]),NOT('Release Details'[Feature State]="Queue"),NOT(ISBLANK('Release Details'[Feature State])),NOT(ISBLANK('Release Details'[Release Name])))),0,CALCULATE(DISTINCTCOUNT('Release Details'[Feature ID]),NOT('Release Details'[Feature State]="Queue"),NOT(ISBLANK('Release Details'[Feature State])),NOT(ISBLANK('Release Details'[Release Name]))))
 
What am i missing here?
  • Hi Anonymous 

    Please try below measure.If it is not your case,could you share your sample data and screenshots which could reproduce your scenario and your desired output so that we could help further on it?

    Feature Plan v2 edit =
    IF (
        ISBLANK (
            CALCULATE (
                DISTINCTCOUNT ( 'Release Details'[Feature ID] ),
                FILTER (
                    'Release Details',
                    NOT ( 'Release Details'[Feature State] = "Queue" )
                        && NOT ( ISBLANK ( 'Release Details'[Feature State] ) )
                        && NOT ( ISBLANK ( 'Release Details'[Release Name] ) )
                )
            )
        ),
        0,
        CALCULATE (
            DISTINCTCOUNT ( 'Release Details'[Feature ID] ),
            FILTER (
                'Release Details',
                NOT ( 'Release Details'[Feature State] = "Queue" )
                    && NOT ( ISBLANK ( 'Release Details'[Feature State] ) )
                    && NOT ( ISBLANK ( 'Release Details'[Release Name] ) )
            )
        )
    )
    

    Regards,

1 Reply

  • v-cherch-msft's avatar
    v-cherch-msft
    Microsoft Employee

    Hi Anonymous 

    Please try below measure.If it is not your case,could you share your sample data and screenshots which could reproduce your scenario and your desired output so that we could help further on it?

    Feature Plan v2 edit =
    IF (
        ISBLANK (
            CALCULATE (
                DISTINCTCOUNT ( 'Release Details'[Feature ID] ),
                FILTER (
                    'Release Details',
                    NOT ( 'Release Details'[Feature State] = "Queue" )
                        && NOT ( ISBLANK ( 'Release Details'[Feature State] ) )
                        && NOT ( ISBLANK ( 'Release Details'[Release Name] ) )
                )
            )
        ),
        0,
        CALCULATE (
            DISTINCTCOUNT ( 'Release Details'[Feature ID] ),
            FILTER (
                'Release Details',
                NOT ( 'Release Details'[Feature State] = "Queue" )
                    && NOT ( ISBLANK ( 'Release Details'[Feature State] ) )
                    && NOT ( ISBLANK ( 'Release Details'[Release Name] ) )
            )
        )
    )
    

    Regards,