Forum Discussion

jimi123's avatar
jimi123
Regular Visitor
3 years ago
Solved

Previous month selected with interval

Hi Could someone help me with the below   I have a slice filter where I have my Month-Year field from my calendar table     I need to have a measure in which I should capture a column fiel...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi jimi123 ,

     

    I created a sample file for your reference.

    Sample data:

    There's no relationship between the main table and the calendar table.

     

    Create a measure for the visual-level filters.

    Measure = 
    var _select=SELECTCOLUMNS('Calendar',"1",'Calendar'[MonthYear])
    var _date1=
    MAXX(
        FILTER(ALL('Calendar'),'Calendar'[MonthYear] in _select),[Date])
    var _datecolumn=
    SELECTCOLUMNS(
        FILTER(ALL('Calendar'),'Calendar'[MonthYear] in _select&&YEAR(MAX('Table'[Date]))=YEAR(_date1)&&MONTH(MAX('Table'[Date]))<>MONTH(_date1)),"1",[Date])
    return
    IF(ISFILTERED('Calendar'[MonthYear]),IF(
        MAX('Table'[Date]) in _datecolumn,1,0),1)

    Put the measure into the Filters and set up show items when the value is 1.

    Here's the result.

                                                                                                                                                             

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.