Forum Discussion
Single Date Slicer to Apply Different Date Ranges to Different Plots
- 5 years ago
Hi amhiggins
Not clear how your data model and table structure look like, so I create a sample:
You may take steps for reference:
Create the measure:
secondmeasure = VAR _max = SELECTEDVALUE ( 'Table'[orderdate] ) RETURN CALCULATE ( SUM ( 'Table'[salestotal] ), FILTER ( ALL ( 'Table' ), 'Table'[orderdate].[Year] = YEAR ( _max ) && 'Table'[orderdate] >= 1 && 'Table'[orderdate] <= _max ) )Result:
When you select 2020.2, secondmeasure counts total during 2020.1-2020.2
When you select 2021.05, secondmeasure counts total during 2021.1-2021.5
Hope it helps.
Best Regards,
Community Support Team _ Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
amhiggins , Assume if date is joined to the table, you are displaying a measure that will filter on selected dates
second one you can use this measure
new measure =
var _max = maxx(allselected('Date'), 'Date'[Date])
var _min = minx(allselected('Date'), 'Date'[Date])
return
calculate([Measure],filter('Date', 'Date'[Date] =_min))
- amhiggins5 years agoFrequent Visitor
I was able to use a form of this measure to get an accurate total but it doesn't work with the colors on the donut chart. It sets each of the colors to 25%.
For reference, this is the measure I implemented to get the total:
New measure = var _max = MAXX(ALLSELECTED(table), table[Date].[Date]) var _min = MINX(ALLSELECTED(table), table[Date].[Date]) return CALCULATE(DISTINCTCOUNT(table[id]), FILTER(ALL(table), table[Date].[Date] < _min))