Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Date filter

EventStart dateEnd dateintheselectedmonthyear
11/01/20215/10/20210
15/11/20211/01/99981

 

Hi, I have a Month and year filter that comes from the date table, I need to select 2021 and November from the slicer and the above measure (intheselectedmonthyear)  should return 0 and 1 as shown above. I tried to havea column called monthyear in the table and have this measure 

intheselectedmonthyear =
IF (SELECTEDVALUE(Dates[MonthnYear])<=MAX(table[End date]),1,0) but returned 0 for all. 
Thanks for the help.
  • Anonymous , Assume month is coming from a date table

     

    measure =

    var _max = maxx(allselected('Date'), 'Date'[Date])

    return

    if(_max <= Max(Table[End date]) ,1,0)

2 Replies

  • Anonymous , Assume month is coming from a date table

     

    measure =

    var _max = maxx(allselected('Date'), 'Date'[Date])

    return

    if(_max <= Max(Table[End date]) ,1,0)

  • Anonymous's avatar
    Anonymous
    Not applicable

    An extension to this. I am counting the number of days in a month when a service is active using a start and end date. I need a matrix view and so far I could achieve this.

    The issue is for a single id/name for the month of March there are multiple start and end date and I am not able to get the total for a month. Its necessary to have all the start and end dates displayed as well. I tried enabling row totals in the Matrix view but doesnot give the total, just repeats the value.  
    Thanks,

    Sreejith