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
Related
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.
i'd want to know if is possible use code for create all schema of power bi (tables, name of all columns).
This becouse i've several db with a schema like this:
tables with same structure that contains data (example: product(column name X01) , customer(column name X02), qty (column name X03), amount (column name X04), month (column name X05) etc.
a table that contains the name of all tables with data (with the same structure) example named TAB1
a table that contains the name of all columns inside tables data example named TAB2 (example X01 product, X02 customer, etc.)
So what i'd like to do (if possible) is to import all tables specified in TAB1
change the name of columns as specified in TAB2
There is a way to do all this via code and not manually, if so, what is the language and where i can find some resources ?
thanks
i've tried to search in internet but i've not found anything
I have a Master Detial with 2 interactive grids.
I would like to be able to genrate a link based on user input....is that at all possible?
To give a simple example:
Lets say I have website like https://www.google.com/
I would like a user to enter anything...for example "Prague"
Once this is entered, I would like APEX to generate a URL from it to result in: https://www.google.com/Prague
Now I know that Google search does not work like that, but I need that sort of mechanism for our internal company app. Is this possible?
Ideally , once the grid is saved the link in the Interactive grid only said "Prague" but if I click it, it would direct me to https://www.google.com/Prague
This can be achieved using the "JavaScript Initialization Code" attribute of the column.
Example on the EMP sample table (*). Functionality is that when a user enters a value in the ENAME column, it is converted to a google search url.
Create an editable IG on table EMP
Set the type of column ENAME to "Text Field"
Set "Javascript Initialization Code" for column "ENAME" to
function(config) {
config.defaultGridColumnOptions = {
cellTemplate: '&ENAME.'
};
return config;
}
Notice that the column now is a link. A user will have to open in new window to get the actual link value, since clicking the column will active the edit mode.
(*) Sample dataset can be installed using SQL Workshop > UTILITIES > Sample Data Sets > EMP/DEPT
yes, you can let user enter the value and by creating a dynamic action(choose the when attribute as whatever suits you) you can take that value and on another column, use that column as &Columnvalue. for example and concatanate it by using to base url using ||
I am working on a Viewership table which tells which customer watches which asset. Based on the asset filter, I need to display the customers who watched the show & customers who didn't watched the show. below is my example table
If the asset_id selected as 1 in the slicer, the desired output will be as below
I have tried creating a cross-join table with asset_id and customer_id , but that approach taking much time with large data. Request the experts here to suggest the best optimal solution to achieve this.
First, create a new table "Asset":
This table contains unique assets, and we will use it to create a slicer that affects DAX measure but does not affect the visual (table). To achieve that, the Asset table must be disconnected from the Viewership table (no relationships).
In your viewership table, I just renamed "asset" to "asset_id", to be consistent:
Next, create a measure:
Status =
VAR Selected_Asset = SELECTEDVALUE(Asset[asset_id])
VAR Customer_Asset = SELECTEDVALUE(Viewership[asset_id])
RETURN
IF(Customer_Asset = Selected_Asset, "Watched", "Not Watched")
Result:
Slicer here is created from the "Asset" table, and table is a table visual with customer_id and asset_id from the Viewership table (set them as "don't summarize" values). I turned off "total", assuming you don't need it.
This design requires to set Asset slicer to "single selection" mode, to make sure that you are only getting one value from it. If you want the model to work with multi-select slicer, change DAX measure as follows:
Multi Status =
VAR Selected_Assets = ALLSELECTED(Asset[asset_id])
VAR Customer_Asset = SELECTEDVALUE(Viewership[asset_id])
RETURN
IF(Customer_Asset IN Selected_Assets, "Watched", "Not Watched")
Result:
Edit:
To make it work at the customer level:
Customer Status =
VAR Selected_Assets = ALLSELECTED(Asset[asset_id])
VAR Customer_Assets = VALUES(Viewership[asset_id])
VAR Assets_Watched = COUNTROWS(INTERSECT(Customer_Assets, Selected_Assets))
RETURN
IF(Assets_Watched > 0, "Watched", "Not Watched")
Result:
Explanation: store selected assets in a table variable. Then, store assets visible per customer in another table variable. Find an intersect of the two tables (what they have in common), and count intersect rows. If none - not watched, otherwise watched. If you want, you can actually display the number of movies watched (just return "Assets_Watched" instead of IF statement).
I have a Power-Bi Report where I need to show the hyperlink in the card or table conditionally. the report is having Account_id as slicer value.
If an account_id results more than 4 records in the visual, I need to add a extra row with text "More.." in it. Reference image is below.
Thanks in advance
I don't if it's possible to get exactly what you want, but here's my attempt. Power BI still isn't great if you need a lot of control over formatting.
First, create a ranking column:
Rank = RANKX(
FILTER(ALL(Table1),
Table1[account_id] = EARLIER(Table1[account_id])),
Table1[Partners], , ASC)
Next, a column that displays the top ones and "More..." for any possible 5th items.
Display = IF(Table1[Rank] > 5,
BLANK(),
IF(Table1[Rank] < 5,
Table1[Partners],
"More..."))
Finally, a column that contains the desired URL for the "More..." rows:
Link = IF(Table1[Display] = "More...", "http://www.URL.com", BLANK())
Here's what my sample data table looks like:
Then you can set up a table with the Display and Link column. Make sure to choose "Don't summarize" for the field and choose URL icon on under values formatting options to get the link icon instead of a URL. You'll probably also want to filter out blanks in your visual fitter settings.
For the right-hand table above I changed the column header texts to "Partners" and " " in the table Values box.