Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I need to perform a string concatenation.
In my report, I have a single Deneb visual (running on vega-lite). Within its dataset, I want to add a column named 'Concatenation' to concatenate all values in 'Value to concatenate', for the selected rows (when I click on them), and appends the result to the dataset, no matter if this row is currently selected or not.
Here is the table in its basic state:
Key | Value to concatenate | Concatenation |
a | valueA | valueA, valueB, valueC |
b | valueB | valueA, valueB, valueC |
c | valueC | valueA, valueB, valueC |
Here is the expected result when I select some of the rows (here in bold):
Key | Value to concatenate | Concatenation |
a | valueA | valueA, valueC |
b | valueB | valueA, valueC |
c | valueC | valueA, valueC |
I tried some DAX formulas with ALLSELECTED, which doesn't seem to work when used within the same visual (but works very well when used on a separated table).
Maybe is there a solution in DAX, or in vega-lite (maybe using __selected__)?
Any help is greatly appreciated!
Your "select" action happens where? In the Deneb visual or somewhere else?
Hello @lbendlin , the select action is performed in the Deneb visual, when clicking on the bars (I presented my example as a table to be more readable, but the Deneb visual is a bar chart).
Then you need to do the computation there too.
Ok I see, so it will necessarily be vega-lite code. I will ask for help on vega forums, but if anyone here have a tip, you're welcome.
Just for information, I also tried some vega-lite transforms, such as joinaggregate, but I didn't find any way to concatenate strings in its context.
For anyone having the same problem. I asked the question on stackoverflow, since the problem is more related to vega-lite/Deneb than to PowerBI itself. You can find it here (not answered at this time): powerbi - How to aggregate a text column? - Stack Overflow
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
8 | |
7 |