In Query Editor, how to get details of a step? - powerbi

I've done some basic things in a query editor via the user interface. For instance, I renamed a column. Now I'm going back to review, but I'm having a hard time figuring out where the details of the step are.
In Applied Steps, on the "Renamed Column", I can right click and go to properties, but it does not list the old and new column name. There is no gear/setting icon to the right. How do I figure out what the new and old column names are?
For the "remove top rows" step, I can click on the gear icon to the right, and get a box with the number of rows, and edit it. How can I do the same with other steps such as renaming columns?

Not all commands have a gear icon in the Applied Steps panel. The Advanced editor can be quite overwhelming at first.
To ease into things, go to the View ribbon and ensure that "Formula Bar" is ticked, like in the screenshot below. Now you can select a step in the Applied Steps panel and its formula shows in the formula bar, very much like in Excel. You can edit the formula and change parameters as you see fit.
You can expand the formula bar to show a few more rows, with the icon at the right of the formula bar.

The code behind the Query Editor is Power Query. Microsoft Power BI ports many useful / frequently-used functions to the user interface for easier / better user experience (but not all functions, obviously).
Therefore, if you want to find the details of a step, you can always go to the Advanced Editor and check out the original Power Query code to find the corresponding line of code. You can also modify the code directly if you understand Power Query.
Below is a screenshot of the Advanced Editor, where the Table.RenameColumns function in Power Query is highlighted, which is the same as Rename Column in Power BI:

Related

Power BI | Collapse and expand lengthy values in one column

I have a column with lengthy values in my Power BI table. I would like it to only show a part of it so that the table isn't hard to navigate, and once the viewer clicks or do something, then it shows the whole value. Is there a way I can accomplish this?
There are posts about collapsing/expanding the whole column, as in keep it disappeared and then appear once you expand or vice versa, but I can't find a way to collapse/expand each values.
Following is an example. As you can see, "Bio" column is very lengthy, so I would it to show maybe a few lines in original view, and once the viewer wants to see the full Bio of that authors, then they can by a click or any action.
Any help would be much appreciated!
OriginalTable
What I want
You can add a column with the truncated version, and a Drill Through to a report page for that single bio.

Power BI Conditional Formatting "Based on Field" List is Empty

I am trying to apply conditional formatting to a field of a table in a report in Power BI online.
The report is connected to a dataset that is in MS Teams and continues to function. All existing conditional formatting is unchanged.
These are the steps I took:
Switch report to edit mode
Select table
Select conditional formatting - advanced controls
In the pop-up window, select "Based on Field"
Then, the drop down list is blank and says {{::placeholderText}}.
This can now be recreated in any report, new or existing, where I attempt conditional formatting.
I tried creating a new report from a new dataset, and attempted to add conditional formatting to a table. The same result happened.
I tried signing out of my Microsoft account and signing back in, but no effect.
I was able to get it working by adding ?conditionalFormattingModern=1 to the url for the online editor like this: https://app.powerbi.com/groups/me/reports/xxx/ReportSection?conditionalFormattingModern=1. (source of idea)
I'm not sure if it will work correctly after I publish the visual though. Apparently this isn't an issue on Power BI Desktop though- so it's probably fine.
Update: Not sure if I'm doing something wrong- but the conditional formatting doesn't seem to be actually applied. It's just that the editor window displays correctly.

Fantasy Premier League API data Power BI

Has anyone worked to get data set for Fantasy Premier League API?
I found the API https://fantasy.premierleague.com/api/bootstrap-static/
I am unable to get data into the Tables, not sure how to transform the data.
Hey I was having the same issue. In case you're still looking for a solution, here's how I was able to get data for the players:
Add Web source using the API link you've included.
In the Power Query Editor - Query Settings > Applied Steps, delete all automatic steps except the first step ("Source")
Go to "elements" row, select "List" ("elements" = players. if you're looking for data on teams instead, do the same steps but go to the "teams" row)
Right click "List" at the top of column 2, and click "To Table". Click "Ok"
To the right of "Column1" at the top, there should be an expand button. Click that and click "Ok"
This is likely the data you're looking for. You can now reorganize this data however you like and apply it.

Group all options with small counts under one label in Power BI charts

I'm creating a PowerBI dashboard for a dataset containing a column "OS", with three main options (Windows, Linux, macOS) as well as in the same column things users entered manually after picking a "Other..." option.
By default, if I render that data in a 1D chart (pie or doughnut), it looks like this:
Something similar happens for e.g. bar charts:
It looks quite clumsy to have all those options with one or maybe two records as individual items.
Is there a way in the charts or query editor to automatically lump the smaller ones together? I'd be happy with a "minimum % for a slice" feature, but also alternatively with a "max N groups" feature (with the last group for "the rest").
I'm happy to do so anywhere in the pipeline as long as it's flexible: input data might change, so writing a computed column with a big switch statement or if/else thing won't help.
Can this be done with Power BI? I can't seem to find a good option anywhere.
Found the solution myself. Click on the dropdown icon for the field you want to group on. For example, if your doughnut chart is set up with:
Legend set to "OS" column
Values as "Count (distinct) of Id"
then click on the dropdown next to "OS":
and then choose "New group". In that dialog you have to:
Pick the main items and "Group" them.
Optionally, add other items that belong in those groups.
Click "Include Other Group" bottom right of the window.
like this...
and finish up. Voila, a "Group" field now exists, to be reused across visualizations.
Not optimal, as it's prone to changes in the data (especially for the "main" groups), but reusable across charts so reasonably useful.

aggregating data in power bi query editor

I have gone through this tutorial
https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-tutorial-analyzing-sales-data-from-excel-and-an-odata-feed/
and was having some issues at Task 4 - Step 1 that I have somewhat resolved but would like to find a better way to complete the task.
The issue of this is that the title of my graph is Sum of UnitsInStock by ProductName but I just want it to be "UnitsInStock by ProductName".
See image below:
Sum of UnitsInStock by ProductName
I think the issue is that in the tutorial link it has the "UnitsInStock" column is aggregated already (which you can see in the field pane) whereas I had to aggregate the data myself. I think to fix this I just have to aggregate the data in the query editor but I haven't been able to figure out how to do this.
If someone could point me in the right direction that would be great!
The button you want is Group By - it's on the Home ribbon in the central Transform section.
Select your grouping columns before hitting it, to preload them in the Group By window. I haven't followed that tutorial so you will need to decide what to select. Any column you don't select for Group By or aggregate (see below) will be removed by this Step.
In the bottom section of the Group By window, click the + button to add an aggregation, then choose Sum and choose your column (e.g. UnitsInStock ). You have to type the output column name.