Forum Discussion

Lauraeire_81's avatar
Lauraeire_81
Helper I
1 year ago
Solved

Where values are blank()

Hi

I've created a measure where I need it to calculate distinct count of values where values are 'yes', if filter is selected and 0 if no filter.

I would like to show '0' or 'No values' if there are no values of "yes" as I continue to get Blanks if this is the case.

 

Here is my current measure:

Measure 5 =
IF(ISFILTERED('Report Results'[Systems]),
CALCULATE(
        DISTINCTCOUNT( 'Report Results'[ServerN]),
        'Report Results'[Out of Support] = "yes"),
  0
)
 

Thanks in advance,

Laura

  • Lauraeire_81 Try using

     

    DAX
    Measure 5 =
    IF(
    ISFILTERED('Report Results'[Systems]),
    IF(
    ISBLANK(
    CALCULATE(
    DISTINCTCOUNT('Report Results'[ServerN]),
    'Report Results'[Out of Support] = "yes"
    )
    ),
    0,
    CALCULATE(
    DISTINCTCOUNT('Report Results'[ServerN]),
    'Report Results'[Out of Support] = "yes"
    )
    ),
    0
    )

2 Replies

  • Lauraeire_81 Try using

     

    DAX
    Measure 5 =
    IF(
    ISFILTERED('Report Results'[Systems]),
    IF(
    ISBLANK(
    CALCULATE(
    DISTINCTCOUNT('Report Results'[ServerN]),
    'Report Results'[Out of Support] = "yes"
    )
    ),
    0,
    CALCULATE(
    DISTINCTCOUNT('Report Results'[ServerN]),
    'Report Results'[Out of Support] = "yes"
    )
    ),
    0
    )