I am new with Power BI and in my dataset I would like to delete some rows. The rows I want to delete have got an ID. However, these indices do not correspond with the row numbers (Row_nr). Basically my data looks like this:
I would like to delete the rows where ID = 7, 14, 16 and 19 (for example, the dataset I use is much bigger) How can I do this in Power BI?
There are several ways to do this. In both cases, edit the data query.
1.) You can filter the data, i.e. select the column filter drop-down, then untick the values you don't want to include.
2.) Or you can create a calculated column with a formula that looks at the ID column and returns a flag, like "keep" or "delete". In the formula you can construct a more complex logic than in the direct filter. The details for that formula will depend on your business logic. Then, in the next step, filter by that helper column and select only "keep". After that you can remove the helper column.
Related
I am loading an Excel file, in which it has 43 rows, all the rows are identical. This is the only file I'm loading and there are no connections relationships in the model whatsoever.
When I plot my data into a table visual, and choose not to summarize any of my fields, Power BI still shows me one row. While if I change any of the field to do a count of it, it shows me correctly that I have 43 rows. I need to be able to see all the 43 rows in my table.
Why is Power BI summarizing my data even if I command it not to do so?
Am I missing something simple?
Input table as seen in Power BI data tab:
The visual I'm trying to create:
The table visual in Power BI behaves similar to a Pivot Table in Excel.
W/o an aggregation defined, the "Values" fields behave like "Rows" in a Pivot Table and you will only see distinct items or distinct item combinations. You have 43 identical records, hence it is represented as one row in the visual.
With an aggregation defined (Sum, Count, ...) the field behaves like "Values" in a Pivot Table, and you get the result of that aggregation, filtered by the distinct items/combinations to the left, which is again one row in your case.
If you just want to show all the records in a table visual, you'll have to make them unique. The easiest way to achieve that is by adding an index column in PowerQuery and then also showing that index in the table visual.
However, this is not exactly what Power BI is made for and you are probably better off by switching to something like PowerPoint instead.
And btw., newer show sceenshots in stackoverflow, always provide sample data instead.
I am trying to set up a dashboard with data that looks similar to this:
As you can guess, all of the 'rate' columns are related. I know to create a graphic that shows the totals for all 'rates' I first need to create a measure that is the sum of these 4 columns. My question is, how do I filter that total, based on the columns in the measure?
For example, if I had a line graph for the 'totals' measure:
Is there any way to create a filter visual that would allow me to see just the AA rates on this graph (that is, only measure the sum of the AA rates) or just the UA rates, etc.? Or is there a way to put all 4 columns on the same graph...
and then create a filter visual so single out one of the values fields?
I am using a power BI matrix report and I want to fill the blank values to 0 in the matrix tables. The data source would be a table from SQL server.
I am looking for options to fill the blank values with 0 using power BI? Any help would be greatly appreciated.
In a given table, (Blank) often comes from "null" in a column. Under Transform data, you can select the column you want to edit, then select "Replace Values" in the Home ribbon. Then it just works like a find and replace in any editor.
As mentioned in the comments, Blank is there for a reason and replacing to 0 may be a bad idea, depending on the data. In general, I try not to destroy any data unless entirely unavoidable.
Consider other solutions:
Like if you just don't want your calculated visualizations to show "(Blank)", do something like Measure = CALCULATE(<something>)+0 and it'll show a calculation of 0 if theres nothing in the column.
If you have a slicer showing a "(Blank)" category, just filter it out in the filters sidebar.
Hello M language masters!
I have a question about working with grouped rows when the Power Query creates a table with data. But maybe it is better to start from the beginning.
Important information! I will be asking for example only about adding an index. I know that there are different possibilities to reach such a result. But for this question, I need an answer about the possibility to work on tables. I want to use this answer in different actions (e.g table sorting, adding columns in group table).
In my sample data source, I have a list of fake transactions. I want to add an index for each Salesman, to count operations for each of them.
Sample Data
So I just added this file as a data source in Power BI. In Power query, I have grouped rows according to name. This step created form me column contained a table for each Salesman, which stores all his or her operations.
Grouping result
And now, I want to add an index column in each table. I know, that this is possible by adding a new column to the main table, which will be store a new table with added index:
Custom column function
And in each table, I have Indexed. That is good. But I have an extra column now (one with the table without index, and one with a table with index).
Result - a little bit messy
So I want to ask if there is any possibility to add such an index directly to the table in column Operations, without creating the additional column. My approach seems to be a bit messy and I want to find something cleaner. Does anyone know a smart solution for that?
Thank you in advance.
Artur
Sure, you may do it inside Table.Group function:
= Table.Group(Source, {"Salesman"}, {"Operations", each Table.AddIndexColumn(_, "i", 1, 1)})
P.S. To add existing index column to nested table use this code:
= Table.ReplaceValue(PreviousStep,each [index],0,(a,b,c)=>Table.AddColumn(a,"index", each b),{"Operations"})
I would like to filter a visual based on the combined value of two columns. In this case I have two of my columns, valueA and valueB, and I would like the row to appear on my visual when either of the two values is greater than 1.
In order to achieve this at the moment I create a custom column with the maximum of both values and then filter on this new column but I would be curious to know if there is a direct way to define the filter taking into account the value of multiple columns without having to add a column to the query each time.
You could created a calculated column using DAX like this:
greaterThan1 = IF(Table1[ValueA]>=1,TRUE(),if(Table1[ValueB]>=1,TRUE(),FALSE()))
Then you would just filter where greaterThan1 = true.