Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Button behaviour - Page navigation

PBI Gurus,

 

Have a requirement - PBI Desktop, Button behaviour

I have 4 buttons in home page:   Migrations, New Borrowers, Industry Growth, Industry Profile.  

They call the individual pages based on bookmarks assigned (for the above 4). 

However, there is an additional requirement: Based on the table User_table   I need to navigate to the page. 

Example (4 records below):

  Table:  User_Table   Columns:  User_Email,           PageNavigate

                                                    [email protected]     Migrations

                                                     [email protected]     New Borrowers

                                                    [email protected]        Industry Growth

                                                    [email protected]        Industry Profile

So when Jack logs in as powerbi user, he sees all the buttons, but when he clicks 'Industry' Buttons nothing happens.  Vice Versa with Jill - Only Migrations & New Borrowers Pages can be seen, when clicked. Something event based, like On Click.  

Any ideas or solution would be greatly appreciated.  

 

Thanks

 

     

 

  • jdbuchanan71's avatar
    jdbuchanan71
    6 years ago

    You can also use the nav meausures to set the button formatting to show the buttons disabled if they don't go anywhere.

    This is the measure to set the color.

    Button background Industry Growth = 
    IF ( ISBLANK ( [Nav Industry Growth] ), "grey","white")

    Then you assign that as the Field Value for the conditional format of the button background.

    Updated file with the button format attached.

     

3 Replies

  • I believe you will need the page nav info on the user table, something like this:

    Then you can write measures to use as the page navigation based on the USERPRINCIPALNAME() function.

    Nav Migrations = 
    VAR _UPN = USERPRINCIPALNAME()
    RETURN
    IF ( 
        NOT ISBLANK (
            CALCULATE(
                COUNTROWS(Users),
                Users[User] = _UPN,
                Users[Migrations] = "Y"
            )
        ),"Migrations"
    )

    This measure will return the string "Migrations" if the logged in user has a "Y" in the Migrations column of the users table.

    You assign this measure as the page navigation measure on a button and when the user can see that page the button will navigate to the Migration page otherwise it will go nowhere.

    I made the 4 measures and assigned them to buttons in my attached sample.

    You can test it by going to Modeling > View As and entering one of the user names.

    Then ctrl clicking on the buttons to see the behavior.

     

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

      You can also use the nav meausures to set the button formatting to show the buttons disabled if they don't go anywhere.

      This is the measure to set the color.

      Button background Industry Growth = 
      IF ( ISBLANK ( [Nav Industry Growth] ), "grey","white")

      Then you assign that as the Field Value for the conditional format of the button background.

      Updated file with the button format attached.

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Awesome, jdbuchanan71 .  Works like a charm! Thank you!!