Introduction
Reports is an excellent tool in Salesforce.  In reports, we can filter, group, and summarize the data in many ways to give the exact information. Filters in reports use static values and they accept any values at run time.
For example, a user wants to see all the records in a report based on the current Account’s state. Here, the filter does not support the dynamic value. So, the user needs to create multiple reports with multiple filter conditions.
This dynamic filter value or dynamic report can be accomplished by using a Custom Link or button approach and passing parameters through an URL.
Steps to create dynamic Report
Step 1:Select the Report tab
Step 2: Select New Report -> Select Report Type
Step 3: Click the Create Button to create a report.
Step 4: Create a Filter
The following thinks are important to note while creating a filter in dynamic report
1.Dynamic filter does not contain any value.
2.Field filter order is important.
3.Report Id.
Add Filter
Step 1: Click Add button or drag and drop the field.
Step 2: Add or select the condition.
Step 3: Ensure the value of the field is Null.
Step 4: Click OK button.
Repeat steps 1 through 4 for any additional dynamic filters.

Filter Order
In Salesforce, add more than one dynamic filter with the field label value. The labels are used to differentiate fields.
The label names start with pv followed by numeric value.

Step 5: Report ID
Step 1: Click the Save button.
Step 2: Enter the report name, description and folder details.
Step 3: Click Save and Run report button.

How to Run the Dynamic Report
Call the Report from the Record Detail Page:
Step 1: Goto Setup -> Search Account in Quick Find Box.
Step 2: Select Buttons, Links, and Actions From the menu.
Step 3: Click New Button or Link from that page.
Step 4: Enter the name and description and select display type as Detail Page Button.
Step 5: Copy and paste the report Id as shown below.

Step 6: Click the Save button.
Step 7: Go to Setup – > search Account in quick find box – >select page layout.
Step 8: Add the custom button to page layout.
Step 9: Go to record detail page and Click the Custom button.


Limitation
- Standard filters (role hierarchy filters, scope filters, date filters), cross filters, and row limit filters aren’t supported.
- Chart filters are not supported.
- You can’t add new filters to reports using filter value URL parameters. You can only modify existing filters.
- You can’t delete filters from reports using filter value URL parameters.
Conclusion
Dynamic reports can be built in Salesforce using a Custom button and Filter fields to dynamically pass a field value from database, and it eliminates the need to create and maintain redundant reports in Salesforce.