Concatenate rows based on user selection - powerbi

I have a table like this:
Ticket Number
Client
Type
T123
Andy
Question
T456
Bob
Issue
T789
Charlie
Problem
I use the filters to display which tickets I am interested in, then open Excel and use
= "www.myticket.url/" & TEXTJOIN("&",TRUE,A:A)
in order to open the url to display all my tickets (in this case, www.myticket.url/T123&T456&T789)
Is there a way to display this dynamically created URL directly in Power BI rather than having to download to Excel?

You can create a measure using CONCATENATEX DAX function to concatenate the values in Ticket Number column, with & separator.
The measure could look like this (where Table is the name of the table):
URL = "http://www.myticket.url/" & CONCATENATEX('Table', [Ticket Number], "&")
Probably you will also want to set the data category of the measure to Web URL.

Related

Power BI LOOKUPVALUE with a column of values for the search items? (VLOOKUP alternative)

In Power BI, I need to create a VLOOKUP alternative. From the research I've done, this is done with the LOOKUPVALUE function, but the problem is that function needs one specific SEARCH ITEM, which isn't super helpful in a VLOOKUP type scenario where you have a full column of values to search for?
Given these two tables, connected through the user_name and first_name columns:
...what's the formula needed in order to create a new column in the Employee_Table called phone_call_group by using the names as the search items in order to return the group they belong to? So how can I end up with this?
(Forget that the entries in each table are already sorted, needs to be dynamic). Will be back tomorrow to review solutions.
In Power BI you have relations between tables instead of Excel's VLOOKUP function.
In your case you just have to create a one-to-one relation between
'Phone_Call_Table'[user_name] and 'Employee_Table'['first_name]'
With that you can add a Calculated Column to your 'Employee_Table' using the following expression:
phone_call_group = RELATED(Phone_Call_Table[group])
and in the data view the table will look like this:
LOOKUPVALUE() is just a workaround if for other reasons you can't establish that relation. What you've been missing so far is that in a Calculated Column there is a Row Context which gives you exactly one value per row for the <search_value> (this is different from Measures):
alt_phone_call_group =
LOOKUPVALUE(
Phone_Call_Table[group],
Phone_Call_Table[user_name],
Employee_Table[first_name]
)

What is the best way to take filter context from Power BI to Power App Edit/Write Data Form?

I am trying to take the filter context from my PBI dashboard to a Power App Edit Form. The scenario is as follows:
I have two tables:
Comments_Table:(empty until write back data is submitted)
Salesperson
Comments
Date
Value
Salesperson_Table:
Salesperson
Information
Salesperson1
1
Salesperson2
2
The Power App should allow users to Write Back data for the following columns to the Comments_Table:
Comments (free text)
Date (date)
Value (free text)
Every new entry should be a new row in the table.
The selected Salesperson should also be written back but should be set by the users' selection in a PBI filter. For instance, in the dashboard, users will be forced to select a unique salesperson, and this should filter the Power App.
I currently have two issues. I have set up a Form that makes a LookUp on a gallery which references the Salesperson table via the PowerBIIntegration.Data. Salesperson is in the form as a view text only item.
I am only able to filter to values that already exist in the Comments table (I prefilled some dummy rows) - it does not currently take the value from the Salesperson table...
Every new entry in the Edit Data Form overwrites the previous entry
for that salesperson. It should add a new of data instead...
Any ideas on how to proceed would be greatly appreciated...

PowerBI how to combine values from 2 tables into a URL dynamically?

Using some sample data, I have table1 with the following values:
Name
Bob
John
Mary
and table 2 with the following values:
folder
documents
pictures
videos
I need to select one value from each table to build a URL. the final URL would be something like:
"https://example.com/Bob/Documents"
"http://example.com/Mary/Pictures"
The person viewing the report needs to choose a name and a folder, then click on a button to load the url.
I haven't been able to do this yet. I can do a dynamic column and get the name, but can't make it get the folder.
Folder table can be rebuild in another way if it solves the problem. Name table comes from Sharepoint and can't be altered.
thanks
You can create a measure using the below DAX, and if it helps then please consider Accept it as the solution.
Measure 5 =
VAR X = SELECTEDVALUE(Tabl11[Name])
VAR Y = SELECTEDVALUE(Table2[Folder])
RETURN "https://example.com/" & X & "/" & Y

Default Power View for Power BI User

I am trying to build a page where it returns table for the logged in user. And then you can use the filter to look at other users records .
User = USERPRINCIPALNAME()
I am having problems filtering the table for the logged in user . Without using row level security with data model changes like below . Is there a way for the Power BI table to return data just for the logged in user ? No SSAS involved.
https://medium.com/#barrasa8/dynamic-data-masking-in-powerbi-based-on-rls-927eb6a34e5d**strong text**
The data model is a FACT table linked to a USER dimension. In the User Dimension , there is an email address which is what the USERPRINCIPALNAME() resolves to.
I thought about a DAX summary table with summarise and may try that later . Then 2 buttons on the page , one to show current logged in user and the other button just gives you details about all other users data and work with all the filters on the page .
So basic want is
Logged In User : X
Table - Col 1 , 2 ,3 .... ( Filtered for User x only by default )
Then I would like a way for the logged in user then to see others user data easily.
Unfortunately there is no way to use USERNAME() or USERPRINCIPALNAME() in DAX measures.
What you're left with is using row level security but that would mean it'll not be possible to show the data of other users.
The best alternative I can think of is to load the data twice. Then set Row Level Security on one table, display that one as "Your data", don't use RLS on the second table and display that as "Other people's data". Put them side by side for easy comparison.
I just wrote a blog post about a similar challenge on how to make sure you can still filter both tables: https://www.linkedin.com/pulse/calculating-totals-row-level-security-using-powerbi-van-der-pasch

Obtain MAX of column and display for each row

I'm trying to obtain the MAX of a particular column in a Power BI Report and place this as a new Measure within each ROW of the same dataset. Please see the example below.
Is this possible in DAX and via DirectQuery/LiveConnection? The report is pointing to a tabular model but due to outside factors the measure must be created in the report.
Thanks
You can accomplish this a few ways. Essentially, you need override the filter context so that the MAX function isn't just running over whatever slice you're showing in the visual. Using CALCULATE or the iterator function MAXX, set the wrap the table in the ALL() function to override the context and calculate max over all rows.
= CALCULATE(MAX([Calendar`Year]), ALL('Smithfield_Fiscal_Calendar'))
or
= MAXX(ALL('Smithfield_Fiscal_Calendar'), [Calendar`Year])
To get the breakout by date, you'll need to include a Date table in your model. PowerBI makes this possible with a few different DAX options. As an example, go to your Model tab, click 'New Table' and put in the following expression:
MyCalendar = CALENDAR(DATE(2019,1,1), DATE (2019,1,10))
This is a little trivial -- you'd want to use a useful range of dates but this one matches your example above. Next, add a column to [MyCalendar]
CalendarMonthYear = month([date]) & "-" & year([date])
Go to your budget table and add a similar field
BudgetMonthYear = month([date]) & "-" & year([date])
Go into your Model view and create a relationship between CalendarMonthYear and BudgetMonthYear. This will associate every date in the date table with the particular budget row from your budget table.
Hope it helps.