Forum Discussion

navenn08's avatar
navenn08
New Member
3 years ago
Solved

DAX ALLSELECTED DISPLAYING BLANKS

Hi All,

I'm trying to create an Average for a count distinct on a time series data, using the below formula i managed to create an Average line

 

AVG_RECEIPTS =
CALCULATE(
    AVERAGEX(Values('DATE'[Date]), CALCULATE( DISTINCTCOUNT(CO_DLY_sample[CLM_NUMBER]))), ALLSELECTED())
 
but how can i avoid displaying those dates with blank values
 

I'm expecting the end result to look like this 

 

Thanks,

Naveen

  • Hi navenn08 
    Please try

    AVG_RECEIPTS =
    IF (
        [TOT_REC] <> BLANK (),
        CALCULATE (
            AVERAGEX (
                VALUES ( 'DATE'[Date] ),
                CALCULATE ( DISTINCTCOUNT ( CO_DLY_sample[CLM_NUMBER] ) )
            ),
            ALLSELECTED ()
        )
    )

2 Replies

  • tamerj1's avatar
    tamerj1
    Community Champion

    Hi navenn08 
    Please try

    AVG_RECEIPTS =
    IF (
        [TOT_REC] <> BLANK (),
        CALCULATE (
            AVERAGEX (
                VALUES ( 'DATE'[Date] ),
                CALCULATE ( DISTINCTCOUNT ( CO_DLY_sample[CLM_NUMBER] ) )
            ),
            ALLSELECTED ()
        )
    )