Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
POSPOS
Post Partisan
Post Partisan

Merge data into final table based on different conditions.

Hi All,

I have a requirement as below based on two tables - Security Table and Transaction Table.

Security table has row level security set up based on the User Name i.e, [username]=userprincipalname()

Security Table

UserNameEmp IDFCOUOU level1
UN1Emp117600530020530020
UN1Emp1176001530021530020
UN1Emp1176002530022530020
UN1Emp1176003530023530020
UN1Emp1176004530024530020
UN2Emp2176003530023530020
UN3Emp3176004530024530020

 

Transaction Table

Emp IDFCOUSalesCost
Emp11760053002010
Emp21760063002061
Emp31860053002200
Emp318600353002319
Emp317600453002490
Emp117600153002179
Emp117600253002254
Emp117600353002333

 

Requirement:

Create a final table using DAX based on three scenarios:

Scenario 1: List all the data based on the data the user has access to in the security table i.e , if a user UN1 logs in,

he will be seeing  the below data:

UserNameEmp IDFCOU
UN1Emp117600530020
UN1Emp1176001530021
UN1Emp1176002530022
UN1Emp1176003530023
UN1Emp1176004530024

Scenario 2: List all the FC the user has access to from the security table and compare them in the transaction table without the user filter(i.e, look for the data in the entire dataset). Check for any additional 'OU' that is not in the security table.

eg: for user UN1, FC are 17600,176001,176002,176003,176004. Now compare this in the transaction table. OU=630020 is not in the security table. 

Emp IDFCOUSalesCost
Emp11760053002010
Emp21760063002061
Emp31860053002200
Emp318600353002319
Emp317600453002490
Emp417600153002179
Emp517600253002254
Emp617600353002333

Output of scenatio 2 will be :

FCOU
17600630020

Scenario 3: List all the "OU" the user has access from the security table and compare those in the transaction table without the user filter(i.e, look for the data in the entire dataset). Check for any additional 'FC' that is not in the security table.

eg: for user UN1, "OU" are 530020,530021,530022,530024. Now compare this in the transaction table. FC=18600,18003 are not in the security table

Emp IDFCOUSalesCost
Emp11760053002010
Emp21760063002061
Emp31860053002200
Emp318600353002319
Emp317600453002490
Emp417600153002179
Emp517600253002254
Emp617600353002333

Output of scenatio 3 will be :

FCOU
18600530022
186003530023

 

Final Output is all the fields from the transaction table with a union of scenario 1,2,3:

UserNameFCOUSalesCost
UN11760053002010
UN117600153002179
UN117600253002254
UN117600353002333
UN117600453002490
UN11760063002061
UN11860053002201
UN118600353002309

 

This final table has to be dynamically updated based on the user who logs in.

 

Can someone please provide any solutions on this. Any help will be much appreciated.

 

Thank you.

2 REPLIES 2
danextian
Super User
Super User

Calculated tables are stored into memory and updates only when

  • the referenced tables/columns have been modifed
  • upon refresh
  • its formula has changed.

It will not change to whoever is logged so you'll have to make do with the final output unfiltered.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
lbendlin
Super User
Super User

This final table has to be dynamically updated based on the user who logs in.

not possible with calculated tables.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors