Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I am trying to find the right formula in DAX for this and getting nowhere.
I have two tables:
I need to create a column on the Projects table which shows, in a comma separated list, the Names of all the contacts where 1) ProjectID on the Contact = ProjectID on the Project, and 2) the Role value for that row of the Contact table contains a certain string.
I have used CALCULATE successfully to do the same kind of thing, summing values on a related table with multiple filter criteria applied to which rows are included, but I'm failing on getting text values concatenated into a comma separated string in the same way.
I need something that works exactly like:
CALCULATE(SUM(column),
FILTER(criteria),
FILTER(criteria),
FILTER(criteria)
)
Except instead of SUM, it returns a text string with all the names that match the criteria. I've been playing with VALUES and CONCATENATEX, but I can't get the syntax to work.
Solved! Go to Solution.
@Anonymous , Create a new column in project table
concatenatex(filter(Contract, contract[project id] = project[project id]),[contract id])
refer: https://docs.microsoft.com/en-us/dax/concatenatex-function-dax
https://www.youtube.com/watch?v=du2HSEzng2E
correct column name as per need
@amitchandak That did it for a single filter criteria--thank you!
What's the best way to do it with multiple fitlers? I just nested a second FILTER within the first, and that seems to work. Is there a more elegant and easier to read method?
@Anonymous , Create a new column in project table
concatenatex(filter(Contract, contract[project id] = project[project id]),[contract id])
refer: https://docs.microsoft.com/en-us/dax/concatenatex-function-dax
https://www.youtube.com/watch?v=du2HSEzng2E
correct column name as per need
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 |
---|---|
55 | |
27 | |
23 | |
14 | |
11 |
User | Count |
---|---|
78 | |
63 | |
46 | |
17 | |
12 |