Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Visible Report Based on Weekend and Weekdays

Hi There,

 

I am stuck in one problem where my requirement is if its weeken my report will only show page for Weeknd, IF its Saturday my report page should only be visible for Saturday and other days report page should be hidden and if its Sunday then my weekdays and Saturday report page should be hidden.

 

IS there anything we can do to create a report page like this?

 

Eg if i am opening report on Monday to Friday ,Only Weekday Page should appear :

If its Saturday then only "Saturday" page will open:

If Sunday then Only "Sunday" page should open rest other page should be hide:


Can anyone help me in reaching this?

 

Thanks in advance!

Ashish

SamWiseOwl  

Ashish_Mathur 

amitchandak 




  • Hi Anonymous 

     

    I don't believe you can hide pages.

     

    Instead you could have buttons whose text and action is based on the day of the week.

    Button destination =

    Switch(
    true()
    ,Weekday(Today(),2) < 6 --If weekday
    ,"Weekdays"
    ,Weekday(Today(),2) = 6
    ,"Saturday"

    ,"Sunday")

    Use this for the button destination and the button text

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Anonymous ,

     

    As SamWiseOwl  said page level security is not possible. But there is an alternative for you to consider:

    (1) This is my test data.

    (2) We can create two columns.

     

    Weekday = WEEKDAY([Date],2)
    Column = IF([Weekday]<=5 && [Weekday]>1,1,[Weekday])

     

    (3) Click Manage Roles on the Modeling tab.

     

     

    var _a=WEEKDAY(TODAY(),2)
    var _b=SWITCH(TRUE(),
    _a<=5 && _a>=1,1,
    _a=6,6,
    _a=7,7)
    RETURN [Column]=_b

     

    (4) View as "Untitled".

    Today is Monday, so output the data for Monday through Friday. For more information about RLS you can refer to:

    Row-level security (RLS) guidance in Power BI Desktop - Power BI | Microsoft Learn

    Row-level security (RLS) with Power BI - Microsoft Fabric | Microsoft Learn

     

    Best Regards,

    Neeko Tang

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

4 Replies

  • Hi Anonymous 

     

    I don't believe you can hide pages.

     

    Instead you could have buttons whose text and action is based on the day of the week.

    Button destination =

    Switch(
    true()
    ,Weekday(Today(),2) < 6 --If weekday
    ,"Weekdays"
    ,Weekday(Today(),2) = 6
    ,"Saturday"

    ,"Sunday")

    Use this for the button destination and the button text

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi SamWiseOwl ,

       

      Appreicate  your help . I will try if this will for for me.

       

      Thank you for your help.

      Ashish

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    As SamWiseOwl  said page level security is not possible. But there is an alternative for you to consider:

    (1) This is my test data.

    (2) We can create two columns.

     

    Weekday = WEEKDAY([Date],2)
    Column = IF([Weekday]<=5 && [Weekday]>1,1,[Weekday])

     

    (3) Click Manage Roles on the Modeling tab.

     

     

    var _a=WEEKDAY(TODAY(),2)
    var _b=SWITCH(TRUE(),
    _a<=5 && _a>=1,1,
    _a=6,6,
    _a=7,7)
    RETURN [Column]=_b

     

    (4) View as "Untitled".

    Today is Monday, so output the data for Monday through Friday. For more information about RLS you can refer to:

    Row-level security (RLS) guidance in Power BI Desktop - Power BI | Microsoft Learn

    Row-level security (RLS) with Power BI - Microsoft Fabric | Microsoft Learn

     

    Best Regards,

    Neeko Tang

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

    • Anonymous's avatar
      Anonymous
      Not applicable

       

      Hi Anonymous 

       

      Thank you for this suggestion . I will look into this .

       

      Thanks,

      Ashish