Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Need to set filter for text

Hi All,
I have scenario in the report I have 3 bookmarks Daily,MTD and YTD. and i have slicer for date range. Bookmarks will work based on slicer date range selection. 
I need to create a visual (Table or Matrix ) for below data but now when I select daily bookmark  the visual should show data for last day of the date range. for MTD it should pick month data based on date range selection. Can any one help here .

Transaction DateItem NumberOrgOld NumberNew Number
01/01/2312345ZXYAB
01/06/2312355ZXYBA
01/11/2312365ZXYAB
01/16/2312375ZXYBA
01/21/2312385ZXYAB
01/26/2312395ZXYBA
01/31/2312405ZXYAB
02/05/2312415ZXYBA
02/10/2312425ZXYAB
02/15/2312435ZXYBA
02/20/2312445ZXYAB
02/25/2312455ZXYBA
03/02/2312465ZXYAB
03/07/2312475ZXYBA

  Thanks in advance

 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous , 

    Here are the steps you can follow: 

     

    1. Enter data – Create a table. 

    2. Create mesaure. 

    Flag =  
    var _min=MINX(ALLSELECTED('Date'),[Transaction Date]) 
    var _max=MAXX(ALLSELECTED('Date'),[Transaction Date]) 
    var _group=SELECTEDVALUE('Group_Slicer'[GroupGroup]) 
    var _monthdate1= 
    DATE(YEAR(_max),MONTH(_max),1) 
    var _monthdate2= 
    EOMONTH(_max,0) 
    return 
    SWITCH( 
        TRUE(), 
        _group="Daily"&&MAX('Table'[Transaction Date])=MAXX(FILTER(ALL('Table'),'Table'[Transaction Date]<=_max),[Transaction Date]),1, 
        _group="MTD"&&MAX('Table'[Transaction Date])>=_monthdate1&&MAX('Table'[Transaction Date])<=_monthdate2,1, 
        _group="YTD"&&YEAR(MAX('Table'[Transaction Date]))=YEAR(_max),1,0) 

     3. Place [Flag]in Filters, set is=1, apply filter. 

    4. Result: 

    Select Daily 

    Select MTD 

     

    Best Regards, 

    Liu Yang 

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

     

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous , 

    Here are the steps you can follow: 

     

    1. Enter data – Create a table. 

    2. Create mesaure. 

    Flag =  
    var _min=MINX(ALLSELECTED('Date'),[Transaction Date]) 
    var _max=MAXX(ALLSELECTED('Date'),[Transaction Date]) 
    var _group=SELECTEDVALUE('Group_Slicer'[GroupGroup]) 
    var _monthdate1= 
    DATE(YEAR(_max),MONTH(_max),1) 
    var _monthdate2= 
    EOMONTH(_max,0) 
    return 
    SWITCH( 
        TRUE(), 
        _group="Daily"&&MAX('Table'[Transaction Date])=MAXX(FILTER(ALL('Table'),'Table'[Transaction Date]<=_max),[Transaction Date]),1, 
        _group="MTD"&&MAX('Table'[Transaction Date])>=_monthdate1&&MAX('Table'[Transaction Date])<=_monthdate2,1, 
        _group="YTD"&&YEAR(MAX('Table'[Transaction Date]))=YEAR(_max),1,0) 

     3. Place [Flag]in Filters, set is=1, apply filter. 

    4. Result: 

    Select Daily 

    Select MTD 

     

    Best Regards, 

    Liu Yang 

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