Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi all. I have a table like this :
What i want is to create a new column in DAX that displayes an array if distinct colours for each ID. So what i want is not collapse the dataframe by grouping by the IDs, but instead one new column like the image below.
Thank you all!
Solved! Go to Solution.
Hi,
Please check the below picture and the attached pbix file.
ID / Column =
CONCATENATEX (
DISTINCT ( colours[ ID] ),
colours[ ID] & ":"
& CONCATENATEX (
SUMMARIZE (
FILTER ( colours, colours[ ID] = EARLIER ( colours[ ID] ) ),
colours[Colour]
),
colours[Colour],
", "
),
UNICHAR ( 10 )
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
@Jihwan_Kim Thank you very much, that's what i wanted! I know I'm asking for too much but what changes should I make to this function if i would like it as a measure instead (I want it to change dynamically upon filtering the table, that's why i would like it also as a measure instead of column in this case).
Hi,
Thank you for your message.
I don't know how your datamodel looks like, or how your expected outcome of the visualization looks like.
Please share your sample pbix file's link with how the expected outcome of the visualization looks like.
Thanks.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
@Jihwan_Kim Thanks for the response. Below is a link with the pbix file. I cannot upload it directly because I am a new member.
https://www.dropbox.com/s/jx9kklf0egq4v4g/colours.pbix?dl=0
So as you can see above, I have a dynamic title on the top left which changes based on the filter measure based on the slicer. I have managed to create an array of all colours which is not what i want. What i want is on the image below(bassically display the selected ids, with their respective colours like below. Thank you!
Hi,
Please check the below picture and the attached pbix file.
ID / Column =
CONCATENATEX (
DISTINCT ( colours[ ID] ),
colours[ ID] & ":"
& CONCATENATEX (
SUMMARIZE (
FILTER ( colours, colours[ ID] = EARLIER ( colours[ ID] ) ),
colours[Colour]
),
colours[Colour],
", "
),
UNICHAR ( 10 )
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Amazing, thank you!
Hi,
Please check the below picture and the attached pbix file.
Colour Array CC =
CONCATENATEX (
SUMMARIZE (
FILTER ( 'Table', 'Table'[ID] = EARLIER ( 'Table'[ID] ) ),
'Table'[Colour]
),
'Table'[Colour],
", ",
'Table'[Colour]
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
User | Count |
---|---|
141 | |
113 | |
104 | |
77 | |
64 |
User | Count |
---|---|
135 | |
123 | |
101 | |
71 | |
61 |