Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hi, I am trying to figure out how to implement this scenario with DAX.
Consider the following matrix with three columns
| id | parameter | cost |
AB | Parameter 1 | 10 |
AC | Parameter 2 | 20 |
AD | Parameter 3 | 15 |
CA | Parameter 4 | 40 |
EF | Parameter 6 | 67 |
FE | Parameter 7 | 80 |
EF | Parameter 8 | 45 |
GA | Parameter 9 | 45 |
CA | Parameter 5 | 52 |
The ID column is the concatenation of two variables that can be combined. I would like to find in the table all the records in which the two variables are swapped among each other.
The final result needs to be
| id | parameter | cost |
AC | Parameter 2 | 20 |
CA | Parameter 4 | 40 |
CA | Parameter 5 | 52 |
EF | Parameter 6 | 67 |
FE | Parameter 7 | 80 |
EF | Parameter 8 | 45 |
Thank you for your support
Solved! Go to Solution.
Hi, @flyingfox
You can try the following methods.
Column:
id2 = RIGHT('Table'[id],1)&LEFT('Table'[id],1)
Table:
New Table = UNION(VALUES('Table'[id]),VALUES('Table'[id2]))
Measure:
Count id =
CALCULATE (
COUNT ( 'New Table'[id] ),
FILTER ( ALL ( 'New Table' ), [id] = SELECTEDVALUE ( 'New Table'[id] ) )
)
Measure = IF([Count id]=1,0,1)
Drag Measure into the view to be displayed and set it equal to 1.
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I set up the secondary key in the model. It works. Thank you
Hi, @flyingfox
You can try the following methods.
Column:
id2 = RIGHT('Table'[id],1)&LEFT('Table'[id],1)
Table:
New Table = UNION(VALUES('Table'[id]),VALUES('Table'[id2]))
Measure:
Count id =
CALCULATE (
COUNT ( 'New Table'[id] ),
FILTER ( ALL ( 'New Table' ), [id] = SELECTEDVALUE ( 'New Table'[id] ) )
)
Measure = IF([Count id]=1,0,1)
Drag Measure into the view to be displayed and set it equal to 1.
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Dear Team_Charlotte,
thank you so much for your valuable support. You undestood my issue and you almost got the result because, I am sorry, I did not mention that each record in the master Table is associated to a date. Therefore dragging your interesting Measure into the view to be displayed and setting it equal to 1, it does not produce the desidered results because the filter does not work due to the missing date in the New Table. Could you help me, please?
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 9 | |
| 4 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 13 | |
| 9 | |
| 9 | |
| 8 | |
| 7 |