Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Please help me create two calculated columns. They can be created in Power Query (I don't care). I would like to create new "Module_Ver 2" and "Value_Ver 2" speakers. I have explained the problem in the pictures below
Link PBIX: https://drive.google.com/file/d/1lebnBAOhJITh1b3DwQjT221upIkNVaDL/view?usp=sharing
Solved! Go to Solution.
Thanks for the reply. Previously, I also tried to use ChatGPT - gpt4, unfortunately it could not help me as in this case
Adding column Value_Ver 2 comes out nonsense:
The expected result is as follows:
Hi @Kris48
To create the two calculated columns "Module_Ver 2" and "Value_Ver 2" in Power BI, you can use the CONCATENATEX
function in DAX. Here's how you can do it:
'YourTable'
with the actual name of your table.'KeyColumn'
with the column you want to group by (e.g., an ID or date).'Module'
and 'Value'
are the columns you want to concatenate.Create a new calculated column in your table with the following DAX formula:
Module_Ver 2 =
VAR CurrentKey = 'YourTable'[KeyColumn]
RETURN
CONCATENATEX(
FILTER(
'YourTable',
'YourTable'[KeyColumn] = CurrentKey
),
'YourTable'[Module],
", "
)
Create another calculated column with this formula:
Value_Ver 2 =
VAR CurrentKey = 'YourTable'[KeyColumn]
RETURN
CONCATENATEX(
FILTER(
'YourTable',
'YourTable'[KeyColumn] = CurrentKey
),
'YourTable'[Value],
", "
)
CurrentKey
: Captures the value of the grouping key for the current row.FILTER
: Filters the table to include only rows with the same key as the current row.CONCATENATEX
: Concatenates the specified column's values (e.g., 'Module'
or 'Value'
) from the filtered table, separated by ", ".If you prefer to do this in Power Query:
Group By Key Column:
KeyColumn
).Add Custom Columns:
Add a custom column for Module_Ver 2
:
= Text.Combine([GroupedRows][Module], ", ")
Add a custom column for Value_Ver 2
:
= Text.Combine([GroupedRows][Value], ", ")
Cleanup:
'YourTable'
, 'KeyColumn'
, 'Module'
, and 'Value'
with the actual names from your dataset.By following these steps, you should be able to create the two new columns as per your requirements.
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn|Twitter|Blog |YouTube
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
7 | |
6 | |
5 |
User | Count |
---|---|
20 | |
11 | |
10 | |
9 | |
6 |