Multiple Search in power bi - powerbi

I have a table with columns Firstname,middlename and lastname , implemented custom 'text filter' to search. How canĀ  I implement multiple search that allows user to enter a word and it should fetch among all the rows with that word matching at least one of the 3 columns.
I tried to implement by creating a new table ,check measure and measure , by union of all the columns.And this procedure is taking more space as a new table is created for it.
Is there any other way to do multiple search other than the above mentioned one so it does not increase the size of the file.

Related

Calculated column in Power BI that repeats different sums based on conditions in 2 other columns

I need a calculated column based on conditions in two columns (Business Unit Number in both tables and L1/Account Categories in 1st table and the second table) which sum and then repeat for several rows before the conditions change and a new sum is repeated for several rows and so on. The L1/Account Categories columns have different names because it's the raw data.
For example, any time ASSETS and 111 appear in the same row, I would want to use those as conditions and with the sum of all of the other matching rows in a new column and the sum would repeat each time both conditions appeared in the same row. Any time P/L and 111 appear in the same row, that would be a sum of all other P/L and 111 appearances in the dataset (about 1000 rows overall)... and so on.
I've tried formulas with DAX using FILTER, SUMX, nested IF statements and also tried the Power Query language among other attempts. Maybe I have to create one or more than one new table? If you need to take a look at a few of my attempts, just let me know.
The top image is how I imagine the output will look in the power query editor and the bottom image is a sample of the source data.
This last pic is from Tableau - I need to make a table in Power BI which essentially a duplicate of this image. The last 2 columns are pulling from different tables.
This should be very simple to achieve with relationships and measures - no need for calculated columns or power query merges. You need to build a relationship between these two tables. In fact, I would introduce a third table in your model for Business unit.
The limitation of Power BI model relationships is that they can only be based on a single column. So to build a relationship between these two tables you would have to add a calculated column in both of them that would contain both a BU and the financial statement line, for instance: JoinCol = CONCATENATE([Business_Unit_Number], [L1]). Then you could create a relationship and do what you want.
The better (one that I would recommend) approach would be to separate Business Unit into a separate table and have relationships built like this:
Then all you have to do in your visual is drag Business unit name from the BU table, L1 from the FS Lines table and a measure to sum the amounts Amount = SUM('Financial Data'[Rolled Up Detail]).
Here is a working sample: https://1drv.ms/u/s!AmqvMyRqhrBpgtUT5HKnZP1U3Gzc9w?e=en91dV

PowerBI - Duplicate Entries in Query

I have created a query on three tables. Here there is a column GUID (which is actually unique), then there is a column date/time and a column with a phone number.
Now if the same phone number calls more than once, get duplicates with always the same GUID. Can I filter this in Power BI so that the ID only appears once?
If I understand your requirement correct, There is an option in Power Query Editor to remove all duplicate rows. You can first select your all 3 columns- guid, date_time and phone_number. Now right click on any of the Column's header and select Remove Duplicate from the list as shown in the below sample image-
This should keep only 1 rows per distinct combination considering 3 columns.

Power BI / Power Query - M language - playing with data inside group table

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"})

count and search combined in Power BI

I have a table and each row is a different class. One of the columns has student names separated by commas. I want to make another table that shows the number of classes that the student is in. Basically, what I need is a DAX formula to combine search and countrows. The first table is what I am starting with. The second table is what I want but cannot figure out an easy way to do it.
I can only think of creating a separate table for each student and then use union to put them all together.
table 1 is what I have
Table 2 is what I want in the end
It is not possible like you want to do it, you need to redesign your first table. This datarow
Class Students
Physics A, B
has to look like this:
Class Students
Physics A
Physics B
You can do this in the under edit querys. Select the column Students and click on Transform > Split Column > By Delimiter. Chose Comma as delimiter and go to the advanced option and check the Rows option. If you hit OK you get the table like you need it to evaluate your data.

Power BI method to Slice string based on "contains text"

I have a string of concatenated data separated by a delimiter "; ". For example: Dog; Cat; Mouse;. (the components of the string can appear in any order leading to a large amount of possibilities)
I am trying to figure out if a custom visual or a method to query the data exists so that if I'm interested in all records that contain "Dog" I can visualize just those....
My first idea was to split the concatenated column in Query editor into 3 separate columns. Then, create a relationship between a table of distinct animals and each of the 3 columns. However, only one active relationship can exists between the distinct animals and the split columns so that's where I stopped.
If this were an excel dashboard I'd just build a VBA drop down box that sliced my data.... so I'm hoping a similar visual slicer exists somewhere....
Back in the Query Editor, after your Split, I would select all the other columns and from the Transform ribbon choose Unpivot Other Columns. This will give you 3 rows for each input row, with each animal name on a separate row.
After renaming the generated Attribute and Value columns, you can create the relationship.
Create a calc column with the FIND function.