Forum Discussion

dax_bi's avatar
dax_bi
Icon for Helper I rankHelper I
4 years ago

Cannot hide slicer on powerbi web

Hi All,

 

I am not able to hide a slicer on the web, it works well on the Powerbi desktop but not on the powerbi web

the below screenshot is from the PBI desktop 

the below screenshot is after publishing to web

 

i have used the below code to get the MTD/YTD selection 

 

MTD/YTD Selection =
VAR TodayDate = TODAY()
VAR YearStart = CALCULATE(STARTOFYEAR('dates'[Date]), YEAR('dates'[Date]) = YEAR(TodayDate) )
VAR MonthStart = CALCULATE(STARTOFMONTH('dates'[Date]), YEAR('dates'[Date]) = YEAR(TodayDate), MONTH('dates'[Date]) = MONTH(TodayDate) )
VAR MonthEnd = CALCULATE(ENDOFMONTH('dates'[Date]), YEAR('dates'[Date]) = YEAR(TodayDate), MONTH('dates'[Date]) = MONTH(TodayDate) )
VAR Result =
UNION(
ADDCOLUMNS(
CALENDAR( TodayDate, TodayDate ),
"Selection", "TODAY",
"Order", 1
),
ADDCOLUMNS(
CALENDAR( MonthStart, TodayDate ),
"Selection", "MTD",
"Order", 2
),
ADDCOLUMNS(
CALENDAR( MonthStart, MonthEnd ),
"Selection", "FULL MONTH",
"Order", 3
),
ADDCOLUMNS(
CALENDAR( YearStart, TodayDate ),
"Selection", "YTD",
"Order", 4
),
ADDCOLUMNS(
CALENDAR(MIN('dates'[Date]),MAX('dates'[Date])),
"Selection", "CUSTOM",
"Order", 5
)
)
Return Result

 

also created the below measure to hide the slicer, so when its 1 ( when custom is selected ) the slicer should be visible else hidden like its in the PBI desktop.

Date Slicer filter =
INT(SELECTEDVALUE('MTD/YTD Selection'[Selection]) = "Custom")

 

Thank you for your time. Hopefully, someone can help me.

7 Replies

  • @Hi dax_bi ,
    Just place a rectangle to hide the slicer and publish it again.

     

     

    Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!!

    Proud To Be a Super User !!!
    LinkedIn

      • Anand24's avatar
        Anand24
        Icon for Super User rankSuper User

        Hi dax_bi ,
        I'm not able to download the pbix you attached.
        However, PFA pbix with what I wanted to convey.

         

        I have 2 date slicers and the left side slicer in this pbix is hidden by using an overlapping white rectangle.

         

         

        Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!!

        Proud To Be a Super User !!!
        LinkedIn

    • dax_bi's avatar
      dax_bi
      Icon for Helper I rankHelper I

      Hi GilbertQ , 

       

      It was working before, the slicer was showing the same as of the PBI desktop before. 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi dax_bi ,

     

    How do you hide the slicer when the "Custom" was selected?

     

    Best Regards,

    Jay

    • dax_bi's avatar
      dax_bi
      Icon for Helper I rankHelper I

      Hi Anonymous 

       

      The slicer becomes visible ( Dates are visible or selection )  when CUSTOM is selected. 

      when you click buttons TODAY, MTD, FULL MONTH, YTD you will see like the below 

      Now when you go to the next Page ( another sheet on the PBI ) and come back to the slicer page it will show like the below, the slicer becomes in visible on the PBI desktop. 

      Now after you publish on the web it shows like the below, you see "0" now which was not like this before. The web after publishing doesnt show the same like on the PBI desktop now.

      Im not ableto upload the .pbix file here so please download the file from the we transfer link below for reference. 

      https://we.tl/t-zNTMeCHAq0