Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Everyone,
I have scenario where i have 2 different date columns by name interviewed date and joining date in an employee table.
Now i want to get list of employee based on interviewed date and joining date.
In google i have searched many videos and blogs but i found measures showing Sum(tables[sales]) for ship date and order date and measures are as follows
sales for order date = Sum(tables[sales])
sales for ship date = calcaulate([sales for order date],userelationship(calendardate[date],tables[date])
Here i am getting total sales this is ok. But in my scenario i want list of employee names instead of total sales so anyone tell me what i need to change in the measure in order to get the list of employee name details.
please help me in writing this measure. Thanks in advance.
Solved! Go to Solution.
I think this should be the appropriate data model
You can then use USERELATIONSHIP in your measures to temporarily activate each of the joins.
Read about USERELATIONSHIP
Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.
https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
Hi @lbendlin
I have taken a sample way to explain my scenario. But below is the real scenario where i am facing the issue. please go through the steps and tell me how to get list of users and their roles in a table based on date selection. I am happy that i have a reply from your end.
I have a scenario where i need to compare list of users and their roles based on selected dates which is named as prior date and current date. This prior date is from the Comparision_Livedate(Calendartable1) and current date is coming from the Live_Date(Calendartable2). Here user will select in date slicer of his own, prior date and current date.
The prior and current dates are connected to main table REM_ROLE_ACCESS_AUDIT_DATA_RPT by column name Row_Load_Date. the prior date - table REM_ROLE_ACCESS_AUDIT_DATA_RPT is having inactive relationship and current date -REM_ROLE_ACCESS_AUDIT_DATA_RPT is haivng active relationship.
I am getting count of users and roles correctly with measures but the enduser need a table visual which shows list of prior users, prior roles, current users and current roles. by comparing the prior and current when the user and role is not present in prior but present in current then the prior user and role should be blank and highlighted with a color and in the same if user and role is not present in current but present in prior then the current user and current role should be blank and highlighted with a color. if the user and role is present in both prior and current then it should be shown normally.
In power bi the table visual is as follows
This is the output i am expecting for the list of users and roles both for prior and current dates.
The above pbi table visual is achieved by conditional formatting of column Full_Name and Role based on the count of prior roles and users, the count of current roles and users. but when the end user export this table visual as excel then conditional formatting of color is not exported and the enduser can see the list of full_name and roles even when they are not present in prior or current so they need to be formatted in power bi table visual itself based on the condition if they Full_Name and role is not presented then it should be blank.
for the count of users and roles based on prior date and current date measures are as follows
count of prior users mesaure is
i have written same condition for current user and current role as when it is 0 it should be blank otherwise it should be list of Full_Name from the table REM_ROLE_ACCESS_AUDIT_DATA_RPT.
The measures are working fine for current user and roles to get list but when coming to prior user and role for list it showing blank even it is 1 and in my view the logic is its taking the list of users and roles from the current date only but not fromt the prior so its showing blank. now i need to do changes in the measure of prior user list and role list that to filter the table REM_ROLE_ACCESS_AUDIT_DATA_RPT, Full_Name column for the prior date and as the relationship is inactive between table REM_ROLE_ACCESS_AUDIT_DATA_RPT and prior date we need to make it active by userrelationship.
so once this two conditions are considered in the measure then we can have list of users and roles for the prior date as well.
---------------------------------------------------
The measure to be modified here is
------------------------------------------------
But i tried to modify the measure for the list of prior users but i am not able to get desired output. So help me in solving this measure as per the desired output.
if any other approach is their to solve this issue then i can work in that perspective as well.
please help me to solve this issue. Thanks in advance.
I cannot help further if you cannot provide usable sample data.
Hi @lbendlin
Thanks for the reply. The below is the sample file of input data and also the pbix file what i have worked upto right now. please do the needful to solve this issue.
https://github.com/Lahari2808/SampleFileData.git
The above is the link for sample data. I hope positive response from your end.
I think this should be the appropriate data model
You can then use USERELATIONSHIP in your measures to temporarily activate each of the joins.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
7 | |
7 | |
3 | |
2 | |
2 |
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
4 |