PowerBI extracting JSON record to a custom column - json

I am taking data from a web source and have expanded all my columns. When everything is split and expanded, my columns look like:
result.col1| result.col2| result.col3| result.col4
val1 | val2 | Record |val4
In here we can see that result.col3 has another JSON record.
What I am trying to accomplish is: How can I create a custom column that reads each Record and outputs a value based off one of the items?
For example the JSON record has:
link: https://google.com
value: 444333
I want the custom column's row to display "A" if value inside the record is "444333"

You could copy the result.col3 column, expand the copy, build your custom column based on the expanded fields, then delete them.

Related

JSON Filter Lookup on SharePoint

I've problem with JSON script.
Which is I have 2 List on SharePoint : first list (marketing catalog) using JSON Script for status column and second list (catalog order)
I've joined it with lookup column on second list (catalog order), but it show all status (active and non active), rather than i need only active is "show"
Thanks
for more detail I attached my screen shoot
JSON Script to filter status
I am using Sharepoint on-premise 2019 (modern). Based on my information the possible way to achieve it is:
You cannot "expand" your lookup column for Choice field (I assume that Status column in Marketing Catalog is Choice field).
Add calculated column (for example StatusHidden) for Marketing catalog only to "copy" Status column as text field.
In Catalog order list show additional field for Calculated column - StatusHidden
In view for Catalog Order, filter items based on StatusHidden column equal to Active.

Expand a table based on JSON string present in a SQL table

We've got a usecase to display a grid in power bi dashbord which contains a JSON obejct in one of its column. The JSON data will based on another column value. 
Based on the category selection, the JSON content should be expanded to table(always one row, multiple columns).
Please find the table below.
Select the JsonData Column, select the Transform TAB and click Parse/Json.
Result is your text becomes records. Now on the right of your JsonData Column you have the dubble arrow, click on it. You do not need the prefix of original name so unselect checkbox. Click OK.
Now you went on level deeper (your column changed to DynamicProperties). Click the dubble arrow again.
End result is the table with all propoerties as in your Json.

How to split JSON columns in Power BI

I have imported JSON data from Hive database. The structure looks like the attached. JSON data has been dumped to Hive without normalizing. Is it possible to parse the data?. For example, in the attached image, the mentionedlocations column has some places mentioned and I want them to be in separate rows.
You can use the Json.Document function to read the column as JSON.
I'd suggest creating a custom column with this formula:
Record.ToTable(Json.Document([mentionedlocations]))
and then expanding that column to get the multiple rows you want.
Putting these together:
= Table.ExpandTableColumn(
Table.AddColumn(PreviousStep, "Custom",
each Record.ToTable(Json.Document([mentionedlocations]))),
"Custom", {"Name"}, {"locations"})
This takes the PreviousStep in the query, adds a Custom column which converts the JSON text into a table and then expands the Name column in each of the tables in the Custom column and renames the column locations.
More easy peasy:
Right click on the column > Transform > JSON
Now use the button at the top right of the same column and Power BI is going to use the JSON element as the column name

(d3.js)(.csv) Exclude column from Stacked Bar Graph

I am using a single .csv file to generate two separate graphs. One is a simple table and the other is a stacked bar graph. The data is currently being read directly from the file as opposed to being converted to a string.
The data is a list of values where the last column is a sum of the values in each row. Ex:
Value1,Value2,Value3,Value4,Total
2,2,2,4,10
1,3,2,1,7
5,2,1,1,9
I would like the "Total" column to appear in my table, but not in my stacked bar graph, but would like to continue using a single data source. Is there any way to exclude a specific column of data from my stacked bar graph?
I am using a copy/paste version of http://bl.ocks.org/mbostock/3886208
Based on the example you linked to, then
color.domain(d3.keys(data[0]
.filter(function(key) {
return key !== "State" && key !== "65 Years and Over";
}));

Display data in SSRS

I have two tables on the SSRS report which displays data depending on the results returned by a single dataset.
The second table displays a subset of data which is displayed on the first depending on some parameters.Now I would like to implement a functionality which displays "no rows" in the second table if the countrows=0 (subset returned from first table) and display the data(subset of data in the first table) if the countrows>0
How can I implement this?
There is a property on the table called "NoRows" that allows you to enter any text you want to show if there are no rows returned.
you can also use this solution:
for your dataset2 click the tablix and at the bottom you shall have Row groups. Click on each of the row groups. So if you have 1 child and 1 parent you will have to do this on both.
1) Right click group_child->group properties->filters and put the following expression "=IsNothing(Fields!Group_Child.Value)="True"" "; set it as boolean expression and 'value'='False' and you will have to do same for Group_parent1 thru n.
This will display NO rows if you have NO data for bottom dataset. If this is the same thing you want to do with Tablix 1 go for it.