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
Anonymous ,
For of if you take a joined date table data will merge in one single date
So use an independent date in the slicer
//Date1 is independent Date table, Date is joined with Table
new measure =
var _max = format(maxx(allselected(Date1),Date1[Date]), "mmdd")
return
calculate( sum(Table[Value]), filter('Date',format( 'Date'[Date] "mmdd") =_max))
Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI