Date based slice

Hello,
I am trying to make an app for customer support. My database like:
Customer Name (using ref) Date Service type
DMCH 01/Jan/2020 Maintenance
DMCH 01/Mar/2020 Repair
DMCH 01/Aug/2020 Repair
ABCD 01/Mar/2020 Maintenance
ABCD 01/May/2020 Maintenance
ABCD 01/Jul/2020 Repair
XYZ 01/Mar/2020 Reaper
XYZ 01/May/2020 Maintenance
XYZ 01/Aug/2020 Maintenance

Now I want to make a slice in which the customer does not get any service in the last 2 months.

0 3 290
3 REPLIES 3

Steve
Platinum 4
Platinum 4

Try:

([Date] < (EOMONTH(TODAY(), -3) + DAY(TODAY())))
  1. EOMONTH(TODAY(), 0) is the date of the last day of this month.

  2. EOMONTH(TODAY(), -1) is the last day of last month.

  3. EOMONTH(TODAY(), -1) + DAY(TODAY()) is todayโ€™s date.

  4. EOMONTH(TODAY(), -2) + DAY(TODAY()) is one month ago today.

  5. EOMONTH(TODAY(), -3) + DAY(TODAY()) is two months ago today.

See also:



Thanks for your support,but I am trying
([Date] < (EOMONTH(TODAY(), -3) + DAY(TODAY()))) then its showing all history without last two month like:
My orginal database:
DMCH -----01/Jan/2020 -----Maintenance
DMCH -----01/Mar/2020 -----Repair
DMCH -----01/Aug/2020 -----Repair
ABCD -----01/Mar/2020 -------Maintenance
ABCD -----01/May/2020 ------Maintenance
ABCD -----01/Jul/2020 --------Repair
XYZ --------01/Mar/2020------ Reaper
XYZ --------01/May/2020------ Maintenance
XYZ --------01/Aug/2020 ------Maintenance

After applying filter on slice its showing:
DMCH -----01/Mar/2020 -----Repair
ABCD -----01/Mar/2020 -------Maintenance
ABCD -----01/May/2020 ------Maintenance
XYZ --------01/Mar/2020------ Reaper
XYZ --------01/May/2020------ Maintenance

now I want: let XYZ get any service in last two month,then this customer all history hide from slice,only showing that customer history which are not get any service last two month.

thanks.

Try this:

AND(
  (
    [Date]
    = MAX(
      SELECT(
        table[Date],
        ([_THISROW].[Customer Name] = [Customer Name])
      )
    )
  ),
  (
    [Date]
    < (
      EOMONTH(TODAY(), -3)
      + DAY(TODAY())
    )
  )
)
Top Labels in this Space