I have a Table -
and an another table like -
.
So I am applying filter for UserName in url(powerbi report server url) and filtering only 'XYZ'. I have to use Users as slicer. Now, if the filter value matches with the Users then "My view" else values present in Users Like -
NOTE : There is not relationship between the two tables.
Related
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...
I need to filter my Power BI report by the App IDs associated with the current user (using the USERPRINCIPALNAME function). So I have three tables in my model, DimApp, DimUser, and FactRegisters, where a User_Id may be related to 1 or more App_Ids in my Fact table.
DimApp table
DimUser table
FactRegister table
As you can see in FactRegisters table there are two App_Ids (3 and 1) for User_Id 201. The following is the DAX rule defined in App_Id column from DimApp table to filter the data:
VAR userId =
LOOKUPVALUE (
DimUser[User_Id],
DimUser[Email], USERPRINCIPALNAME()
)
VAR app =
LOOKUPVALUE (
FactRegisters[Application_Id],
FactRegisters[User_Id], userId
)
RETURN DimApplication[Application_Id] IN {app}
Verifying the DAX expression doesn't return an error, however, when I choose to "View as" that role I'm not able to see the data in the visuals. The error states: "Couldn't load the data for this visual. An error was encountered during the evaluation of the row-level security expression defined in table DimApp. A table of multiple values was supplied where a single value was expected."
Cannot display the visual viewing as role
However, when a single App_Id is associated with the User_Id, I'm able to visualize the data on the report visuals using the same DAX rule. Here is how FactRegisters table looks like when User_Id 201 has a single App_Id (3) associated:
FactRegisters table when User_Id with single App_Id
User_Id with a single App_Id visual
Now I'm I able to visualize data in the report. This is not a suitable case scenario as a User_Id can have many App_Ids.
I also tried the following static DAX rule in my App_Id column from DimApp just to test and pass multiple values to that column, and I succeed in visualizing data for multiple App_Ids:
DimApplication[Application_Id] IN {1,3}
Static RLS with multiple values by App_Id column
But this is not the goal (it's not dynamic). The goal is to visualize the data from all the Apps associated with the current user. Is it possible? Can't I pass more than one value to a column while filtering in RLS?
[Application_Id] IN
CALCULATETABLE(
VALUES('FactRegister'[Application_Id]),
FILTER ('FactRegister',
'FactRegister'[User_Id] = LOOKUPVALUE (DimUser[User_Id], DimUser[Email],USERPRINCIPALNAME())
)
)
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
I am working on a report that deals in employee feedbacks. I have different cards on top to show -
(Requests Received,Type of requests(social/others/security),Requests reported/not reported and expired).
All these cards have data based on a measure - Count of Employee IDs = count('vw_EmployeeFeedback'[Employee_Id]) + 0 and respective filter fields dragged on to them to show category type etc.
Below them I have a table to show the detailed view of the data. Such as names of manager raising the request, Request raised for(name field) , status of requests, submitted date etc. coming from the same view as Count of Employee Ids.
I want the cards to filter based on the selection of a row in the table.
The edit interaction are set to filter the cards, but all go zero or blank when I select a row in the table.
Please let me know how I can achieve this. Thank You!
I am assuming that you have different tables for your data source/s that is why it is not filtering when clicking the table entry. Try establishing the relationships of your tables. Just go to Models and then Manage Relationships. If it's not the case, then you need other solutions.
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).