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.
I'm trying to find the smallest value of [comment_id] in the table in the attached screenshot given a [target_id]. In the example, let's say I am using the [target_id] value of 3366. The [type] value is also 2. In the table 'Ticket Comments Relations', we can see that the [target_id] value of 3366 gives us two matching rows as highlighted. Their [comment_id] values are 59714 and 59719.
My DAX formula for a column in another table is
CALCULATE(MIN('Ticket Comments Relations'[comment_id]); FILTER('Ticket Comments Relations'; 'Ticket Comments Relations'[target_id] = 3366 && 'Ticket Comments Relations'[type] = 2))
This gives me the correct number of 59714, the lesser of the two [comment_id] values. However, this column is hard-coded as using 3366 as the value for all the rows. There exists two tables with a one-to-many relationship to each other ('Tickets' to 'Ticket Comments Relations'). 'Tickets' contains the unique value of 3366, as a previous example, and 'Ticket Comments Relations' might have many instances of 3366.
How can I make my formula use the unique value in 'Ticket's instead of the hard-coded 3366?
Solved! Go to Solution.
@Anonymous , Assume the other table ticket has target id we can create a new column in ticket like
New Column in ricket =
mix(filter('Ticket Comments Relations','Ticket Comments Relations'[target_id] = ticket[target_id] && 'Ticket Comments Relations'[type] = 2),'Ticket Comments Relations'[comment_id])
@Anonymous , Assume the other table ticket has target id we can create a new column in ticket like
New Column in ricket =
mix(filter('Ticket Comments Relations','Ticket Comments Relations'[target_id] = ticket[target_id] && 'Ticket Comments Relations'[type] = 2),'Ticket Comments Relations'[comment_id])
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 | |
94 | |
83 | |
67 | |
59 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |