Forum Discussion

srdjanmish's avatar
srdjanmish
Helper I
6 years ago
Solved

Date calculation - empty fields

Hi guys...   I have a situation, a problem. I have a Dataset, created from dataflows, that has table (table name: DataTable1) with 2 date fields. One field is for document date, and the other is fo...
  • v-deddai1-msft's avatar
    v-deddai1-msft
    6 years ago

    Hi srdjanmish ,

     

    The reason for the blank value is that your dateslicer also filters the original table. Please refer to the measure below:

     

    MeasureDifference =
    VAR MaxSelectedDate =
        CALCULATE ( MAX ( 'Calendar'[Date] ), ALLSELECTED ( 'Calendar' ) )
    RETURN
        CALCULATE (
            DATEDIFF ( MAX ( 'Datatable1'[DueDate] ), MaxSelectedDate, DAY ),
            CROSSFILTER ( 'Datatable1'[Document date], 'Calendar'[Date], NONE )
        )

     

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

     

    Best Regards,

    Dedmon Dai