PowerBI blank data template - mdx

Currently I'm working on a dashboard template in PowerBI that will be piloted in the desktop version. The template is filled with data based on the user's authorization through a filter applied within the MDX query. However when spreading the template to others for piloting, it is still filled with data based on my personal authorizations which is only replaced as soon as the user refreshes using his personal authorizations.
I'm looking for a solution that does not break the template but also makes sure that my data is not shown to others when opening the template, in other words how can I make sure the user sees an empty template (no data) when opening the file.
I've tried blanking the filter parameter (results in data errors and missing columns thus breaking the dashboard)
Can anyone help me find a solution?

You may add a template user (just for report creation) and set the Scope statement around your measures:
Scope(AddCalculatedMembers([Measures].Members));
This = IIF(
[Measures].CurrentMember
and
UserName() == "domain\template.user",
"Blank",
NULL
);
End Scope;

Thanks for the replies. I've managed to solve the problem with a simple solution. By adding a try structure around the Table.RenameColumns function after the MDX I was able to capture a blank query and use Table.FromRecords to manually add the otherwise retrieved columns with a blank row. This prevents all subsequent queries and measures from returning errors and thus blanking all figures when the user parameter is invalid. Then finally just add any invalid value to the user parameter and save as a template, voila.

Related

Dynamic Column Headers working in Power Query but NOT on the Daschboard

I've been working with .xlsx files whose column headers change. As a result in Power Query I used Table.ColumnNames{1} to create dynamic headers that prevent me from getting an error when updating queries.
Despite no longer getting errors, dashboard is simply not working. whenever column names change, the matrixes and charts on the dashboard no longer recognize which columns were there.
How can I solve this?
Try solution from Curbal canal
https://www.youtube.com/watch?v=zUaVpgAdVGs

SSRS Action to Change Value of Variable

I'm using SSRS 2008 R2 to create a report which is a directory of contacts so people can find this easily. I've got the report working but the list is huge so I want to add dynamic filters by setting text boxes up that if anyone clicks on it, the results will be filtered.
I've set up a test report with a text box with an action to re-open the report but with the parameter set to ="A" to only pull back contacts beginning with the letter A. However, when I click this, I get the following error:
The report parameter 'Initial' is read-only and cannot be modified.
(rsReadOnlyReportParameter)
As an alternative, I've thought about adding a variable to the report and basing the parameter on this value. The only thing is that, although there's plenty out there showing how to change the value of a variable, I cannot seem to find a way to set up an action to change one.
Any ideas?
No worries everyone - I've found the answer. The first solution works but the parameter has to be set to hidden, not internal as I had set it up.

Access Query uses Form Inputs as Parameters - Runs manually, not through Form

I have a query that accepts input from a form. The query works as expected when I run it, manually typing in the form input values. However, when I run the query from the form, the query returns blank - no error, just blank.
I don't understand what's causing it - at it's most basic, the user is simply entering a Start and Stop date. I'm entering the data exactly the same, and made sure my form text box is formatted as a date.
Furthermore, when I run the form, I am not prompted for any values, so I know it's reading them accurately. This system works for several similar queries, but not this one.
What I've tried
Changing the format of the text box to specify Short Date (which is how I type it)
Visually confirming the values are making it from the form to the hidden staging area the query references - these values match what I manually enter into the prompts
The query I'm runnning references another query; running the other one by itself only yields one set of "date" prompts, not two. So I created a seperate date input box for each to read off of, but to no avail
Question: Does Access try and format (or not format) parameter input boxes differently than it would handle form references?
Additional detail - when I run the query manually, it prompts me for the dates twice - I don't know why or it's pertinent, but I thought I'd mention it.
use instead Temporary variable in your Query for the specified dates. After you select the dates from the Form, make sure that the values are assigned to the temporary variables and that you requery the record source of the form
I was able to get this working by tweaking my query in the designer - specifically by splitting up my expression into multiple pieces and writing the criteria in segments.
I'm not sure why this did the trick, but it at least got me where I needed to go.
Good luck to anyone else experiencing this!

RDLC subreport filter error

I'm using a Local Report in Report Viewer 2008.
I'm trying to do something I think should be real simple. I have a subreport that I want to do some filtering on. I want to do a skip/take functionality, although I can't even get the most basic of filters working.
The subreport has a matrix. I've tried adding filters to the report datasource (Report -> Data Sources... -> Properties... -> Filters) and to the matrix itself. Unless I do something like =true for a filter, I get an error, subreport could not be shown.
For an example, I have an integer called Order in my data source. I thought I could do =Fields!Order.Value > 1 and that would make the report use every row but the first one, but I get the subreport error.
Running the application in the debugger will display report warnings to output. I was expecting something a bit more helpful, but no luck...
Warning: An error occurred while executing the subreport ‘ImageSubreport’: An error has occurred during report processing. (rsErrorExecutingSubreport)
I've used filters a lot before, so I'm kind of confused why this doesn't work.
I think I'm starting to get somewhere. I thought I could write my filter as one large expression and compare it to true/false in the filter editor. I changed my simple filter expression to be =Fields!Order.Value, selected ">" in the dropdown, then set the comparison to =CInt(1). I think the key was mostly the CInt call. I'm still trying to tweak it to my particular filter though, but I think I can get there.

How to filter a Sharepoint List Column with a Textbox Control Value using a "Contains" query?

I'm using a data view to display a list (Sharepoint 2010) that has several columns including one that has a Name column. I've provided the user with a text filter on the page to send values to filter the Name column in this list. The problem I'm facing is that the filter only works for exact matches and not partial matches.
I tried to overcome this problem by using Sharepoint Designer to:
create a parameter that uses the textbox control value.
Filtering the Name column with this parameter and setting the comparison to "Contains"
Unfortunately if the default value of the Parameter is blank, the list does not display any data. If the default value of the parameter is set to part of a name in the list, the list displays names that contain that string. However, when changing the value in the text box and searching, the list does not return results. Please let me know if you guys know how to fix this. Any help is much appreciated and let me know if you need any additional information. Thanks!
Managed to find a solution to my problem. I used a custom javascript solution designed by jvossers (http://instantlistfilter.codeplex.com) that involves the list being filtered instantly much like Google's search!
The only downside of this solution is that it only filters the items currently displayed on the screen. Therefore, if you have a data view web part which limits the amount of items displayed on the page, this solution won't help you. In order to facilitate this solution, display all the row items on the page (by increasing the item limit per page to a larger number than your total list rows) and then add this code into a content editor web part on the same page. Worked brilliantly for me. '
By the way if you are using jQuery 1.3.x or higher, you should modify the script a little as described in the disscussion here: http://instantlistfilter.codeplex.com/Thread/View.aspx?ThreadId=49123