Forum Discussion
Getting different data based on a Range column.
- 4 years ago
Hi Anonymous,
You may try this solution.
1 Modify your Selected Date as follows
SelectedDate = VAR _SelectedDate = MAX ( 'Calendar'[Date] ) VAR maxDate = CALCULATE ( MAX ( 'Calendar'[Date] ), ALLSELECTED ( 'Calendar' ) ) RETURN DATE ( YEAR ( _SelectedDate ), MONTH ( maxDate ), DAY ( maxDate ) )2 Create another Measure
OrdersBySelectedMonth = VAR selectedMaxDate = CALCULATE ( MAX ( 'Calendar'[Date] ), ALLSELECTED ( 'Calendar' ) ) RETURN CALCULATE ( [Order Count], FILTER ( 'Calendar', MONTH ( 'Calendar'[Date] ) <= MONTH ( selectedMaxDate ) ) )The result looks like this.
Also, attached the pbix file as reference.
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know. Thanks a lot!
Best Regards, Community Support Team _ Caiyun
Hi Anonymous,
You may try this solution.
1 Modify your Selected Date as follows
SelectedDate =
VAR _SelectedDate =
MAX ( 'Calendar'[Date] )
VAR maxDate =
CALCULATE ( MAX ( 'Calendar'[Date] ), ALLSELECTED ( 'Calendar' ) )
RETURN
DATE ( YEAR ( _SelectedDate ), MONTH ( maxDate ), DAY ( maxDate ) )
2 Create another Measure
OrdersBySelectedMonth =
VAR selectedMaxDate =
CALCULATE ( MAX ( 'Calendar'[Date] ), ALLSELECTED ( 'Calendar' ) )
RETURN
CALCULATE (
[Order Count],
FILTER ( 'Calendar', MONTH ( 'Calendar'[Date] ) <= MONTH ( selectedMaxDate ) )
)
The result looks like this.
Also, attached the pbix file as reference.
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know. Thanks a lot!
Best Regards, Community Support Team _ Caiyun