I am trying to create a new mobile report using the SSMS 2016 SQL Server Report Publisher. Each time I try to create a new graph using the data from my data source, SSMS doesn't recognize any metrics to display on the graph. It appears that each of my columns have a filter-esque symbol next to the text, prohibiting me from using that column as a metric. How can I alter my data to remove this symbol and furthermore, what does this symbol represent?
Visual Example:
Answer: You cannot analyze data that is not aggregated. For example, the data in your data tables must be either be evaluated through the count function, sum function, avg function, etc. or else it cannot be used in the reporting services.
From what I've seen, the data types are important to your metric that you want to plot must be a numeric/integer/money data type.
Related
I have a table in SQL Server that contains document-related data. Data entry in this table is handled from ASP.NET code:
I have to show this table data in PowerBI desktop. With normal Select query I could bind the data in table of Power BI desktop. But along with this table data I have to show one more column IsProcessedBefore which I have to compute for each row.
This column values could be '1' or '0':
1 indicates that this particular Document Number has been processed earlier
0 indicates that this particular Document Number has not been processed earlier.
Output should be shown in Power BI desktop report as shown below.
I am not getting how could I compute this indicator for already existing data.
Whenever a new entry is done in the SQL Server table. It must be reflected same in the PowerBI report along with the computed indicator value.
Please help me with this scenario.
One way that I found is to create another page in same Power BI report, showing the number of times the documents processed using group by query on documentnumber and documentId (Output Shown below). But this is just workaround. Using this approach we will be having two pages. One could check documentnumber from actual table data in below output and refer its count. If its count is greater than 1 that means it is processed earlier.
.
But this workaround does not match up with the exact requirement.
My issue is similar to this one Multiple data types in a Power BI matrix but I've got a bit of a different setup that's throwing everything off.
What I'm trying to do is create a matrix table with several metrics that are categorized as Current (raw data values) and Prior (year over year percent growth/decline). I've created some dummy data in Excel to get the format the way I want it in PowerBI (see below):
Desired Format
As you can see the Current values are coming in as integers and the Prior % numbers as percentages which is exactly what I want; however, I was able to accomplish this through a custom column with the following formula:
Revenue2 = IF(Scorecard2[Current_Prior] = "Current", FORMAT(FIXED(Scorecard2[Revenue],0), "$#,###"), FORMAT(Scorecard2[Revenue], "Percent"))
The problem is that the data comes from a SQL query and you can't use the FORMAT() function in DirectQuery. Is there a way I can have two different datatypes in the same column of data? See below for how the SQL data comes into PowerBI (I can change this if need be):
SQL
Create 2 separate measures, one for the Current second for Prior, and format these measures.
Probably you can also use a case in SQL query to format your data to bring it as STRING.
What I wound up doing was reformatting the SQL code to look like this:
Solution
That way Current/Prior are have two separate values and the "metric" is categorical.
I got the idea from this post:
Simple way to transpose columns and rows in SQL?
I have to display tabular data whose structure (columns and headers) changes depending on an ID. For ID "A" I would get columns "Name|Address|valid" but for ID "B" I would get "Name|Birthday|Sex|".
The dynamic structure would be implemented by a stored procedure that returns different tables based on the ID.
Is it possible to create a generic report based on this?
In the report I would like to be able to filter based on the columns like one is used to from Excel. Also the headers of the columns would be dynamic ...
If you are using Qlikview 11, you can use conditional show/hide for each dimension/expression in charts.
Use an expression like
GetFieldSelections(ID) = 'A'
in the condition section of the chart properties for the other dimensions
If you are using QLikSense, you can do this through the API but it seems it breaks the purpose of QlikSense (which is pure adhoc discovery as compared to guided analytics of Qlikview 11).
If you are using Qlikview 10, you can do this by saving the expression in a variable and calling the variable in the dimension of your chart.
I am creating a report to display values from scalar valued database function.
It is my intention that the report look like this having each of these values be discrete and not come from a single query. The labels are for display purposes. I am thinking of using a matrix control but that seems to work with aggregates.
I am reporting on data that lets say has 10 columns. Now some of my clients have data in all 10 of the columns whereas some may only use 7 or 5... you get the idea. Of course I dont want to have to build a new rdl for each possibiliy. Well in the tabular report I can hide the columns fine if no data exists by using the IsMissing property.
Well in the charts, let's say a bar graph, if there is no data for a column it will not show a bar on the graph (which is great) but all of the potential columns still show up in the series legend.
I've read that 2008 gives you that level of chart customization, but 2005 does not. Any other ideas?
I think I actually answered my own question (well, it will work for my scenario). I used the UNPIVOT function available in SQL Server 2005 to put the column data into rows. This gives me a dataset of two columns (Field and Result) with multiple rows now. Now in the SSRS chart, I just drop the Result into the data and the Field into the series and this works out great.
I'm using 2005, but I think for the bar chart that you might be able to do something like this.
Chart properties -> Data Tab -> Series Groups (edit) -> Filters -> Add the appropriate filter to remove series that you don't care about.