Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
anusha_2023
Helper III
Helper III

Remove rows based on the button click

I have a Resource table which is connected to facts booking table and Date Table. Need to create a button called "Clear Specialist data". I want to have a button in the report to remove data for Resource names starting with "* Speacialist" . And other button to bring the data back to the report. Let me know how to achieve this possibility in all the paginated reports. I tried with appying filter for all the pages but I need this option made easy for end users with a simple button click. Please let me know the possible ways. This is my sample model.

model.PNG

 

1 ACCEPTED SOLUTION

I have tried a work around with creating a calculated column with fileds to show unassigned and not unassigned and filter on the visual to show the appropriate check box in order to filter the resource names. Thank yo very much for your detailed steps

View solution in original post

5 REPLIES 5
anusha_2023
Helper III
Helper III

Thanks for the reply. Measure has been created but I need change as below it seems.

IsUnassigned = IF(MAXX(FILTER('resource', SEARCH("* Unassigned", 'resource'[name], 1, 0) > 0), 1), 1, 0)

Then when I have selected button in the visualization pane I cannot see options Values to add the measure. I am getting blank as below.

anusha_2023_0-1705587095006.png

Please let me know work aroud this step. Thanking you

t seems like you're trying to create a measure that checks if a resource name contains "* Unassigned". The DAX measure you provided is correct for that purpose.

However, if you are not able to see the measure in the "Values" field when adding the button in the visualization pane, it could be due to a few reasons. Here's a step-by-step guide on how to add a button with the measure:

Step 1: Create the Measure

 

IsUnassigned = IF(MAXX(FILTER('Resource', SEARCH("* Unassigned", 'Resource'[Name], 1, 0) > 0), 1), 1, 0)

 

Step 2: Add a Button Visualization

  1. Go to the "Home" tab.
  2. Click on "Text box" from the "Home" tab's "Home" ribbon.
  3. A new text box will be added to your report.

Step 3: Edit the Button

  1. With the text box selected, go to the "Visualization" pane.
  2. Drag the "IsUnassigned" measure to the "Values" field in the "Visualization" pane.

Step 4: Configure the Button

  1. In the "Fields" pane, you should see the "IsUnassigned" measure under "Values."
  2. Configure the text box to display the result of the measure (1 for true, 0 for false).
  3. Customize the appearance of the text box to make it look like a button.

Step 5: Set Actions for the Button

  1. Right-click on the text box.
  2. Under "Action," choose "Bookmark."
  3. Select the appropriate bookmarks for showing/hiding Unassigned data.

Step 6: Test the Button

Click on the text box/button to see if it toggles between showing and hiding the Unassigned data.

If you're still having trouble, double-check that the measure is created in the correct table ('Resource' table in this case) and is visible in the "Fields" pane. Also, ensure that your button is correctly configured to use the measure. If you encounter any issues, feel free to provide more details, and I'll be happy to assist further.

 

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

 

In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.

Thanks for the detailed steps again. For the third step I could not see values in visualization pane for text box and in format pane i could not see the Action option too. Below are the screen shots.

anusha_2023_0-1705671787933.png

 

 

But if i gave the measure in the value as shown below I am getting 1 as display. If that is what you mean to set the ction for this textbox as I could not see any Action in the Format option.

anusha_2023_1-1705671918078.png

 

Step 3: Edit the Button

  1. With the text box selected, go to the "Visualization" pane.
  2. Drag the "IsUnassigned" measure to the "Values" field in the "Visualization" pane.

I have tried a work around with creating a calculated column with fileds to show unassigned and not unassigned and filter on the visual to show the appropriate check box in order to filter the resource names. Thank yo very much for your detailed steps

123abc
Community Champion
Community Champion

To achieve this in Power BI, you can use a combination of measures, buttons, and bookmarks. Here's a step-by-step guide:

  1. Create a Measure to Identify Specialist Data:

    • Open Power BI Desktop and go to the "Model" view.
    • Create a new measure that identifies the rows you want to hide. For example:

IsSpecialist = IF(SEARCH("* Specialist", 'Resource'[Resource Name], 1, 0) > 0, 1, 0)

 

    • This measure will return 1 for rows where the Resource Name starts with "* Specialist" and 0 otherwise.
  1. Create a Button to Hide Specialist Data:

    • Go to the "Home" tab, click on "Buttons," and select a button type (e.g., blank button).
    • In the "Visualization" pane, add the "IsSpecialist" measure to the "Values" field well of the button to make it interactive.
    • Set the button text to "Clear Specialist Data."
  2. Create a Bookmark to Hide Specialist Data:

    • Go to the "View" tab and open the "Bookmarks" pane.
    • Create a new bookmark (e.g., "Hide Specialist Data") and set the state of the "IsSpecialist" measure to 1.
  3. Create a Button to Show All Data:

    • Add another button for showing all data, and set the button text to "Show All Data."
  4. Create a Bookmark to Show All Data:

    • Create a new bookmark (e.g., "Show All Data") and set the state of the "IsSpecialist" measure to 0.
  5. Add Actions to Buttons:

    • Select the "Clear Specialist Data" button, go to the "Format" pane, and under the "Action" section, select "Bookmark" and choose the "Hide Specialist Data" bookmark.
    • Similarly, set the "Show All Data" button's action to the "Show All Data" bookmark.
  6. Test Your Buttons:

    • Go to the "View" tab and click on the "Data" view.
    • Test your buttons to ensure they hide and show the data based on the specified conditions.
  7. Add Buttons to All Pages:

    • Ensure that the buttons and measures are present on all pages of your report.

By following these steps, you should be able to create a paginated report in Power BI with buttons that allow end-users to easily hide and show data based on your specified conditions.

 

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

 

In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.