Incorrect data being pulled from a SharePoint list to Power BI - sharepoint

When I pull data from a SharePoint list into Power BI, the values are pulled incorrectly for columns having the data type -
Person or Group - instead of names, numerical values are pulled. I guess these are the IDs of the values
Lookup - instead of the actual values, '[list]' is pulled in a nested column. When I expand, numerical values are shown. Again, seems like IDs
All other data types are pulled properly.
To work around this problem, I first pull the data from the list to Excel and then to PBI. However, I want to eliminate this manual step as the list will have frequent updates and I will need to pull the list data into Power BI regularly.
What should be done to pull the actual values as they appear in the list?

For the lookup columns: You need to pull in the lists where the lookup values are being looked up from and then create a relationship based on ID.
For the People: Look here:fully explained how to deal with Person object

I did some looking around and was able to find a solution.
Using the FieldValuesAsText column in the Query Editor, I got the values in the table. values for both column types were available. Since, I only needed the text values it solved the purpose.

Related

How do I use XL Data Tables with XLOOKUP for Data Validation

I have a data table based on a query -> tblPrimaryProducts
tblPrimaryProducts has many columns, some of which are Category, SubCategory and Item.
If I were to use a filter on Category I would of course be able to see the SubCategories and Items in that Category. Likewise if I were to apply a filter to SubCategory in turn I would see a list of on the items in that specific Category + SubCategory selection. Ultimately this is the goal of data validation I am trying to implement.
There is a data entry table -> tblPackages
tblPackages has many fields, but importantly the three listed above need to be implemented in a controlled way via data validation so that each row can have the correctly selected Category + SubCategory + Item
I am unable to change the data table into an array or simple (or dynamic) named range because it will be refreshed any number of times and the column positions will potentially alter. This means that I have to use the table based naming system for both tables.
What I have so far is the following for a data validation formula using XLOOKUP:
XLOOKUP([#[Primary Category]] & [#[Primary SubCategory]], tblPrimaryProducts[Category] & tblPrimaryProducts[SubCategory], tblPrimaryProducts[Item],,0)
[#[Primary Category]] and [#[Primary SubCategory]] are fields in the tblPackages data entry table. The other fields listed come from tblPrimaryProducts. So far I have entered data by hand to test this out.
In the XL Formula window (where you can 'see' what your formula is doing while you fill in the fields) this seems to work and provides the output expected.
When I try to implement this as data validation it complains about an error in formula. If I place an INDIRECT at the beginning I get the syntax error popup. I have had issues in the past with INDIRECT that have been solved with the careful use of quotation marks. I cannot seem to find a way here to do this.
Does anyone have any ideas on how I might implement some data validation based off of a data table (as opposed to an array), or the query that the table is based on in this situation? Under normal circumstances I would use dynamic named ranges but here I cannot.
Any help or ideas greatly appreciated
In Office365 the following formula will get you the list of "Items" that satisfy the "Category" and "Subcategory" conditions.
=FILTER(tblPrimaryProducts[Item],(tblPrimaryProducts[Category]=[#[Primary Category]])*(tblPrimaryProducts[Subcategory]=[#[Primary Subcategory]]),"")
It will give you a #SPILL! error if inserted in a Table and it returns multiple items that match the two criteria. You may have to redesign your output table.
If you are intending to display just the filtered values, you can then use two dropdowns with list of categories and subcategories. The filter function can then use these cells to filter the Items from source data and display as a list below.

Power Query: how can I make power query tolerate columns with the same name?

I have a table with several column having the same name.
This columns is updated and provided regularly to power bi.
The columns has several columns with the same name such as "Result", "Result" and do so on...
However, Power BI adds each time in an automated way a number after my columns.
When I try to "force" power bi not to have a number, I get the following message
"The name "Result" is already used for a column..."
How could I change this?
The only way would be for the people using my file to extract the data and correct the name manually in excel...which is not great
You cannot edit this behavior, PowerBI needs an unique identifier to reference the data, therefore the column name must be unique within a table (the complete identifier is given by table + column), otherwise the tool won't be able to reference the data.
This rule usually applies to any tool that manages data and sometimes to the data themselves (that's up to the format though). How can the tool get data from "Result" if more than one column has this identifier? which is the right one? The tool does not know and based on the context can give you an error or will fix this issue itself by making the names unique.
Note that also excel will append numbers to the columns (with the same name names) if you put the data in a proper table (insert-> table), in fact, an excel sheet can be considered unstructured free data, meanwhile, an excel table will enforce the data structure.
Most tools (like PowerBI) will also enforce data types.

SharePoint List tables

I'm working on a project for work, and I'm attempting to move data from a database with multiple references to different tables.
My question is; is it possible to move the data and be able to have a list that references different lists? For example, when I click on an element in the list, can I create another "link" to take me to another list?
I am not sure but if I understand the problem well You would like to create some kind of column in one list which will store reference to item from other list, correct?
If so then You are looking for lookup columns. When adding column to a list You may select lookup column type, after that You need to select which list You would like to 'reference' and which column should be present from the second list in the lookup column from the first list. Please check the reference link
OOB lookup column(similar concept as database foreign key) will be good, while CSR will be helpful for complex scenario also.

Dynamic validation list in Excel

I have an issue regarding data validation in Excel, namely how to dynamically set the validation source.
I have three tables, where the first contains a product ID and a product name. The second table contains a product ID together with a serial number. A third table has three columns; one for product ID, one for serial number and a description for e.g. error reporting.
What I want to do is related to the third column where I select the product ID in a drop-down box which is linked to the first table. This works perfectly fine. The second column though, must only allow serial numbers related to the product ID selected according to the relationship in the second table. Hence, the data validation list must be dynamically generated by the input in the first column.
The reason for having it in Excel is due corporate reasons and personally I'd use an SQL-database for this very issue. E.g. if I were to use SQL-syntax to generate the validation list, the corresponding SQL-statement would be:
SELECT serialNumber WHERE productId = 12345;
I've tried using the INDEX-MATCH, but unfortunately MATCH only returns a scalar value rather than an array. I have not come across array functions prior to today, but I assume such might be included in order to accomplish this and have tried a bit without success.
If I somehow were to acquire an array returning the row numbers where there is a match, the INDEX-function would accomplish my needs, I presume.
My question is therefore, is there a method to acquire an array of matched values or can my problem be solved using a more elegant solution? If it could be of value if it can be made without VBA, also for corporate security reasons.
Thanks in advance!

PowerPivot to list data values instead of summarising

Just starting with MS PowerPivot. I am trying to create a pivot showing the list of responses to questions in a survey, but am falling over where the powerpivot wants a 'Summarize by' value for the pivoted responses.
In a sql query to return these data I would use max(AnswerComment) (as there will only be one answer per respondent per question). However, when I select Max as the Summarize by values, PowerPivot returns: ERROR - CALCULATION ABORTED: Calculation error in measure 'Answer'[Maximum of AnswerComment]' and then explains that only numbers or dates (and not Strings) can be 'MAX'ed.
Is there a way of listing pivoted data (rather than performing a summary calculation on it)? If not, is there a summary function that PowerPivot accepts for string types?
thx
mcalex
By definition, PowerPivot doesn't let you list text values out. The way to workaround this is to place the column onto a row and then make sure you have another measure that includes all values of that column (traditionally dimension).
Saying this, a common approach is to build a Power View report on top of your PowerPivot workbook. This will allow you to list the values.

Resources