Forum Discussion

jmkvalsund's avatar
jmkvalsund
Helper III
4 years ago
Solved

Can I select a bookmark based on current month when loading report?

I have a slicer showing month of year. I have not found a way to set the slicer to current month when the report opens, so I have to change that manually month by month. Small job, but it has to be done... So, another approach, if I create a bookmark for each month, can I then trigger the actual bookmark based on which month it is? I.e. by creating a measure holding current month? Or by any other value? Suggestions appreciated, 

 

regards,

John Martin

 

 

  • Hi, jmkvalsund 

     

    You can try the following to set the slicer to the current month.

    Column:

    Monthnum = MONTH([Date])

    Measure:

    Measure = IF(SELECTEDVALUE('Table'[Monthnum])=MONTH(TODAY()),1,0)

    Place Measure in the slicer's view filter and set it to equal 1.

         

    The slicer then displays only the current month's options. Is this the result you expect?

     

    Best Regards,

    Community Support Team _Charlotte

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

5 Replies

  • truptis's avatar
    truptis
    Community Champion

    Hi jmkvalsund , Please try this:
    Step 1-> Transform data -> (in power query editor) click on Add column->Custom Column (Current Month)

    put this DAX:
    Date.MonthName( DateTime.LocalNow() )

    Click on OK -> Apply & Close changes 

     

    Step 2:

    In the report view, put the slicer and use current month(that we made in step 1) as date field.

    Step 3: Select the slicer -> Go to Format pane-> Selection control -> turn ON the Single Select option

    This will default your slicer to be at current month.

    jmkvalsund -> Please mark this as a solution & hit the thumbs up if it helps you. Thank you. 

     

    Regards,

    TruptiS

     

  • Sorry folks, unforunately this will not help.
    My slicer is a multiselect option-box. When current month is i.e. march, I want the three first boxes to be checked, since the report default should show accumulated results from january to march. I haven't found any other way to make the slicer come up with multiple options checked as default, than using bookmarks. And then the challenge is to select the actual bookmark (1 out of 12) when the report is being loaded.

    • jfsuarez's avatar
      jfsuarez
      Regular Visitor

      Hi, having the same problem... did you found a way around? Thanks

  • PijushRoy's avatar
    PijushRoy
    Community Champion

    HI jmkvalsund 

    Please create serial for your month in DAX

     

    Select the Month Name or Month No Col and go to Sort By option, and select SERIAL  sort

     

    In Drop Down slicer, select Sort by MONTHNAME 

     

    SO YOUR SLICER ALWAYS SHOWS, CURRENT MONTH FIRST. GO TO SLICER SETTING AND SELECT OPTION, SINGLE SELECT, SO YOUR CURRENT MONTH IS SELECTED BY DEFAULT.

    If not solved, Please keep posted
    If solve your requirement, please mark this answer as SOLUTION
    If this comment helps you, please LIKE this comment/Kudos

  • v-zhangti's avatar
    v-zhangti
    Community Support

    Hi, jmkvalsund 

     

    You can try the following to set the slicer to the current month.

    Column:

    Monthnum = MONTH([Date])

    Measure:

    Measure = IF(SELECTEDVALUE('Table'[Monthnum])=MONTH(TODAY()),1,0)

    Place Measure in the slicer's view filter and set it to equal 1.

         

    The slicer then displays only the current month's options. Is this the result you expect?

     

    Best Regards,

    Community Support Team _Charlotte

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