Query Parameter in Paginated Report - powerbi-paginated-reports

I am using Paginated Reports against a dataset in the cloud. I am trying to build a query parameter (not a report parameter). I want the report to function such that when user selects a date in the query parameter dropdown, the results will return the past 13 months, ending on the date they select in the slicer. I only see options for 'equal to', 'begins with','contains', 'range(inclusive)', 'ranage(exclusive)', nd 'custom'. I thought about modifying the query logic that is automatically created, but don't know how to modify it to bring back 13 months of data ending on the date they select in the parameter. Is there a way to do this in the paginated report itself? Trying to avoid having to create a PBI query and pass slicer values. Thanks for any ideas

Related

Power BI Paginated Report - monthly parameter

I require your guidance for my needs.
I want to create a parameter based on month that will help me filter the data report based on the selected month parameter. Example if the parameter I choose is January then I want to put the filter on my datasets only the January.
Currently I create default parameter by get the first date and last date of the current month and previous month. I want to upgrade these parameter with just select the month.
Hope you all can get what I need.
Thank you in advance.
You have two options:
1- Create the parameter and enter the available values as a list manually
2- If you have a date table in your dataset, you can create a dataset that queries this table and returns the list of the months. You would then use this query as a source for your parameter

Passing multiple values to subreport parameter - SSRS

I have a report that has 4 parameters:
Year - accepts a single value for a year - ex: 2020
Carrier Group - allows the user to select a single carrier grouping
Segment - allows the end user to select one or multiple business segments
Loss Cause - allows the end user to select one or multiple loss causes
And when I execute this report:
The report generates as expected - and I have the SSRS report set up so it creates a new tab in Excel when exported to separate the monthly totals vs the cumulative totals.
But the end users would like to be able to execute this report for multiple years to compare - so I have created a parent or main report - then I created a tablix and added the sub-report to be called - and created a row group based on the Year(s) selected.
My subreport parameters are as follows:
What I am ultimately hoping to accomplish is to pass in a single year plus the carrier group, segments and loss causes that were selected - and run the subreport for each of the years the user may select.
For example, if the user selects 2016, 2017, 2018 - the sub-report would need to be run 3 times to generate the totals for each of those years using the same parameters for carrier group, segment and loss cause.
I'm not sure what is happening but with the Year parameter as it: =Parameters!Year.Value(0) - the report looks like it keeps generating one year over and over:
I also tried using =JOIN(Parameters!Year.Value,",") but that did not seem to help either.
Anyone have experience on how to solve this type of issue? Thanks,
The easiest way to do this is to add a dataset to your main report that returns one row per year.
If you have a dates table or similar in your database then you could do something like
SELECT DISTINCT Year(myDateColumn) as [myYear]
FROM myDatesTable
WHERE Year(myDateColumn) IN (#Year)
If you don't have a date table then (other than suggesting you add one...) you could create one on the fly with something like
SELECT * FROM (
SELECT top 20
ROW_NUMBER() OVER(ORDER BY name) + 2000 as [myYear]
FROM sysobjects) o
WHERE myYear IN (#Year)
(adjust the top 20 and +2000 as required to get a range of years that covers all your potential data)
Now set the dataset property of the tablix in your main report to point to this new dataset.
In your subreport object's parameters, set the value for the Year parameter to the [myYear] field in your dataset by selecting it from the drop down or using =Fields!myYear.Value as the expression.
Now that the tablix is bound to the dataset, it will create one row for each record returned from the "dates" dataset, each row will have a different year which is passed to the subreport, so the subreport is called once for each row/year.

SSRS: Variable that runs query based on a (date) parameter value entered by user?

So I have a report with approx 15 datasets.
The report has a date parameter so the user can run for whichever date they want.
Each dataset has sql logic that basically determines:
If #parameter_date does not exist in table
then grab the max date from table < #parameter_date
else
use #parameter date
This works and the report works properly as is.
However, I was trying to see if I can have this sql logic in 1 place (rather than 15 times in the beginning of each dataset query) and store it in a global variable, and pass the proper date into the dataset?
When I look at report properties and "variables" it only looks like I can write an expression, not write sql and return a date based on a query.
I'm sure there is an efficient way of doing this, any help would be appreciated.
Thank you

Ssrs tablix filtering

I have filtering implemented at tablix level in an ssrs report.
The tablix is using a dataset which is getting lots of records from database using a stored procedure.
The report has parameters whose values are used to filter the tablix data.
First time when the report executes it gets all the data from stored procedure and bind it to tablix with all the details as parameters default value is set to select all.
I want to know when user enters parameter values and click on view report , does the report executes the procedure again , get the entire set of data and then filter based on input parameters?
Or the ssrs report is smart enough to know that already the data which was fetched the first time will be used to filter the data in the tablix
First let's talk about the difference between query parameters and report filters. Parameters are passed into the query so that it can run faster and return targeted results. Filters are applied after the fact so the full query has to run and then the report has to go through the records and check criteria row-by-row.
In addition to those options, SSRS offers caching. This allows you to save the query results so that the query is only re-run when needed. This is configured on the report server, not in the report properties.
The best optimization will vary by report. As a general rule it's best to pass parameters into the query/procedure and just get the data you need. If that is too slow, let the query get all the data, cache it, and just use filters at the report level.

Trying to rename filters in Report Builder

I am working with SSRS 2K5 and I have some questions that I haven't been able to answer via Google related to Report Builder. I have built my report and I am using a Model to generate the report. It is my understanding that Report Builder does not support parameters when the underlying datasource is a model so I have setup a filter that the user is prompted to fill in prior to the report being generated no problem. Here are my two problems:
The filter in question is a date field. If I set my filter to do a BETWEEN (date from to ) there is no option to prompt the user for the values prior to the report being ran. Is there some way to get around this?
If I was able to get the above desired date range effect by placing the date field in the filters area twice: once with a condition of 'Before' and the other with a condition of 'After'. The problem here is how the filters are displayed namely Date and Date 1. Ideally I'd like these to be displayed as Start Date and End Date, respectively. Is there any way to do this?
Please let me know if I need to clarify anything or more information is needed.