Forum Discussion
srdjanmish
6 years agoHelper I
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...
- 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
v-deddai1-msft
6 years agoCommunity Support
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
srdjanmish
6 years agoHelper I
Thx v-deddai1-msft ,
Somewhere in back of my brain i was aware of that filter rule, but, did not use that part of brain, obviously...
Thx again, problem solved, and solution accepted...