Forum Discussion

itsmeanuj's avatar
itsmeanuj
Helper IV
3 years ago

Pick only selected rows to create table visual

Hi,

 My data looks like this with few more columns as attributes.

ProductIDRankCall DateCall Status
A10111-JanFailed
A10122-Jansuccess
A10133-Janfailed
B10215-Janfailed
B10223-Jansuccess
B105110-Jansuccess
B105212-Janfailed

 

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.

 

ProductIDRankCall DateCall Status
A10111-JanFailed
B10215-Janfailed
B105110-Jansuccess

 

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

2 Replies

  • itsmeanuj I think you have already solved it, the measure you created if you use it in a visual level filter where measure is not blank and that will do it. 

    • itsmeanuj's avatar
      itsmeanuj
      Helper IV

      Thanks parry2k . It worked. Do you know how we can add a row at the end for the total count of rows in this specific scenario? e.g in the above scenario it should say total = 3.