Sum of values where non-consecutive date range is selected

Let’s say you want to use the slicer below for a date range. How would you calculate values based on this slicer if the dates are not consecutive? most of the time intelligence functions require consecutive dates. Any ideas?

I know how to get the selected values from the slicer with no problem, just not how to use them to get the sum of other fields for the time period selected.

Date Range non consecutive

Hi @DeanJ,

You can use calculate function to achieve this. Try below

Non ConsDate =
   CALCULATE (
        SUMX (
            Table1,
             Table1[Column]
           ),
         SELECTEDVALUE( Date[Date] )
     )

Sorry for not providing with exact data as replied by phone.

@DeanJ Can you share PBI file and what you exactly want to do?

MK,
Thanks for your response. That does not work in this case because SELECTEDVALUE has more than one distinct value and returns blank.

Thanks for your reply. Let me work on creating a .PBIX file with some test data and I will post it.

Try to share a sample file surely @AntrikshSharma will help you.

Please see attached file. I’m trying to create a measure with the amount for the selected period when the dates selected are not consecutive.

Non- Consecutive Dates.pbix (2.9 MB)

@DeanJ That was easy, maybe I didn’t understand what you want to achieve.

Non- Consecutive Dates.pbix (2.9 MB)

2 Likes

Thanks for your help- I see now that it was simple. I think it was dealing with dates that way that threw me off - I am used to always using date functions on dates. This is a little different way to look at it.

1 Like

@DeanJ I will post the solution on PBI community as well so you can close the thread there as well.