Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi All,
Kindly could you provide some guidance how i can solve this scenario
I have a table of say four columns.
Acc Customer Security Expiry
1 123 ABC 24/12/2024
2 321 CBA 25/12/2021
3 142 ADB 21/03/2020
4 321 BCA 21/04/2026
4 333 BCA 21/04/2026
5 333 ACD 21/04/2026 etc.
I am looking for a query to identify all accounts by customer 321 and if joint ownership then to also fetch all account of joint owners. Is there a way i can do it in DAX?
Thanks and Regards
SD
Solved! Go to Solution.
Hi @sushdutta
Please try this:
Table:
First of all, create a calculated table:
Table 2 = SUMMARIZE('Table','Table'[Acc],'Table'[Customer])
Create a Slicer with 'Table2'[Customer]:
Then add a measure:
MEASURE =
VAR _vtable =
SELECTCOLUMNS (
FILTER (
CROSSJOIN ( 'Table 2', ALLSELECTED ( 'Table' ) ),
'Table 2'[Acc] = 'Table'[Acc]
),
'Table'[Customer]
)
RETURN
IF ( MAX ( 'Table'[Customer] ) IN _vtable, 1 )
The result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @sushdutta
Please try this:
Table:
First of all, create a calculated table:
Table 2 = SUMMARIZE('Table','Table'[Acc],'Table'[Customer])
Create a Slicer with 'Table2'[Customer]:
Then add a measure:
MEASURE =
VAR _vtable =
SELECTCOLUMNS (
FILTER (
CROSSJOIN ( 'Table 2', ALLSELECTED ( 'Table' ) ),
'Table 2'[Acc] = 'Table'[Acc]
),
'Table'[Customer]
)
RETURN
IF ( MAX ( 'Table'[Customer] ) IN _vtable, 1 )
The result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @sushdutta, give this a try, and if you encounter any issues, let me know. change YourTableName to your table name.
AllRelevantAccounts =
VAR TargetCustomer = 321
VAR TargetCustomerAccounts =
CALCULATETABLE(
VALUES('YourTableName'[Acc]),
'YourTableName'[Customer] = TargetCustomer
)
VAR JointOwners =
CALCULATETABLE(
DISTINCT('YourTableName'[Customer]),
'YourTableName'[Acc] IN TargetCustomerAccounts,
'YourTableName'[Customer] <> TargetCustomer
)
VAR AllCustomers =
UNION(
{TargetCustomer},
JointOwners
)
RETURN
FILTER(
'YourTableName',
'YourTableName'[Customer] IN AllCustomers
)
Did I answer your question? If so, please mark my post as the solution! ✔️
Your Kudos are much appreciated! Proud to be a Solution Specialist!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 14 | |
| 7 | |
| 5 | |
| 5 |
| User | Count |
|---|---|
| 29 | |
| 18 | |
| 17 | |
| 11 | |
| 10 |