Forum Discussion
Pick only selected rows to create table visual
Hi,
My data looks like this with few more columns as attributes.
| Product | ID | Rank | Call Date | Call Status |
| A | 101 | 1 | 1-Jan | Failed |
| A | 101 | 2 | 2-Jan | success |
| A | 101 | 3 | 3-Jan | failed |
| B | 102 | 1 | 5-Jan | failed |
| B | 102 | 2 | 3-Jan | success |
| B | 105 | 1 | 10-Jan | success |
| B | 105 | 2 | 12-Jan | failed |
I have created a measure below to calculate the distinct count of Product & ID.
Measure =
var tbl = SUMMARIZE(ALLSELECTED(Data),Data[PRODUCT],Data[ID],"Min Rnk", MIN(Data[rank]))
var result = CALCULATE(DISTINCTCOUNT(Data[ID]), TREATAS(tbl,Data[PRODUCT],Data[ID],Data[rank]))
return result.
This is working absolutely fine. Now I want to create a table visual that would interact with the above measure and pick the row with the minimum rank for each product, and ID combination. here is the output I need in the table. in short the count in the above measure should match with the number of rows in the details table.
| Product | ID | Rank | Call Date | Call Status |
| A | 101 | 1 | 1-Jan | Failed |
| B | 102 | 1 | 5-Jan | failed |
| B | 105 | 1 | 10-Jan | success |
Please note this needs to be dynamic as we have a call date slicer at the top. so if the user filters out all the dates before 2-Jan, then product A with rank 2 and its respective values in other columns would be selected.
Can you please help me create this in PBI
Thanks,
Anuj