Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Dear Community,
Let's say that I have this table:
ID Index Status
A 1 X
A 2 X
A 3 Y
A 4 Y
A 5 Y
A 6 Z
A 7 Z
B 8 X
B 9 Y
B 10 Y
B 11 Z
B 12 Z
B 13 Z
C 14 A
C 15 B
C 16 A
C 17 A
C 18 P
C 19 P
C 20 F
I want to capture the different transitions of the statusses by ID.
So this should be the result:
ID Index Status Transitions
A 1 X X-Y-Z
A 2 X X-Y-Z
A 3 Y X-Y-Z
A 4 Y X-Y-Z
A 5 Y X-Y-Z
A 6 Z X-Y-Z
A 7 Z X-Y-Z
B 8 X X-Y-Z
B 9 Y X-Y-Z
B 10 Y X-Y-Z
B 11 Z X-Y-Z
B 12 Z X-Y-Z
B 13 Z X-Y-Z
C 14 A A-B-A-P-F
C 15 B A-B-A-P-F
C 16 A A-B-A-P-F
C 17 A A-B-A-P-F
C 18 P A-B-A-P-F
C 19 P A-B-A-P-F
C 20 F A-B-A-P-F
This is the DAX script I am currently using but it doesn't give me the right (distinct) result:
= CONCATENATEX(FILTER(Table;Table[ID]=EARLIER(Table[ID]));Table[Status];"-";Table[Index])
I am currently getting the following result:
ID Index Status Transitions
A 1 X XX-YYY-ZZ
A 2 X XX-YYY-ZZ
A 3 Y XX-YYY-ZZ
A 4 Y XX-YYY-ZZ
A 5 Y XX-YYY-ZZ
A 6 Z XX-YYY-ZZ
A 7 Z XX-YYY-ZZ
B 8 X X-YY-ZZZ
B 9 Y X-YY-ZZZ
B 10 Y X-YY-ZZZ
B 11 Z X-YY-ZZZ
B 12 Z X-YY-ZZZ
B 13 Z X-YY-ZZZ
C 14 A A-B-AA-PP-F
C 15 B A-B-AA-PP-F
C 16 A A-B-AA-PP-F
C 17 A A-B-AA-PP-F
C 18 P A-B-AA-PP-F
C 19 P A-B-AA-PP-F
C 20 F A-B-AA-PP-F
Any help is appreciated!
Solved! Go to Solution.
@Anonymous try this measure
Unique Status =
CONCATENATEX(
CALCULATETABLE(
VALUES ( 'Table'[Status] ),
ALLEXCEPT('Table', 'Table'[ID ] )
),
'Table'[Status],
"-"
)
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Throw a DISTINCT in there:
= CONCATENATEX(DISTINCT(FILTER(Table;Table[ID]=EARLIER(Table[ID])));Table[Status];"-";Table[Index])
Thanks @Greg_Deckler for your response. The formula didn't work for me.
I got the following message:
Failed to save modifications to the server. Error returned: 'A circular dependency was detected: Table[Transition].
'.
============================
Call Stack:
============================
at Microsoft.AnalysisServices.Tabular.Model.SaveChanges(SaveOptions saveOptions)
at Microsoft.AnalysisServices.Tabular.Model.SaveChanges(SaveFlags saveFlags)
at Microsoft.AnalysisServices.BackEnd.DataModelingSandboxTabular.UpdateDatabase()
at Microsoft.AnalysisServices.BackEnd.SandboxTransactionTabular.CommitUpdates()
at Microsoft.AnalysisServices.BackEnd.DataModelingSandbox.CommitUpdates()
at Microsoft.AnalysisServices.BackEnd.DataModelingView.Update()
at Microsoft.AnalysisServices.BackEnd.DataModelingView.UpdateAddedColumns(List`1 addedColumns, List`1 oldExpressions, IList`1 colIndices)
at Microsoft.AnalysisServices.BackEnd.DataModelingView.ChangeFormulas(IList`1 colIndices, IList`1 names, IList`1 expressions, Boolean suspendImpact)
at Microsoft.AnalysisServices.BackEnd.DataModelingView.ChangeFormulas(IList`1 colIndices, IList`1 names, IList`1 expressions)
at Microsoft.AnalysisServices.Common.SandboxEditor.ChangeFormula(TableWidgetPanel currentTable, IList`1 colIndices, IList`1 names, IList`1 expressions, Boolean doFormulaBarCommit, IList`1 displayIndices)
============================
Do you have any suggestions?
@Anonymous try this measure
Unique Status =
CONCATENATEX(
CALCULATETABLE(
VALUES ( 'Table'[Status] ),
ALLEXCEPT('Table', 'Table'[ID ] )
),
'Table'[Status],
"-"
)
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@parry2k I don't get the results I want to have. I have added a variant (ID 'C') which result isn't correct.
This script only concatenate the unique statusses:
@Anonymous would recommend to create a new post and tag me in it. Also share sample data.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |