Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

How to count distinct ID by groups but keeping filter context

Hello, 

 

I've encountered a problem, which I think should have easy fix but I'm completely stuck with this. 

I have a table visual in PBIX with data restricted by DATE and Region filter - and I want to keep the filters. 

 

I want to add a measure that would count distinct ID, grouped by Name, where status is CLOSED but disregard the date context within the visual (but keep it from slicer). 

So for example something like this 
For the row with name "Nina" status is "In Progress" so I have blank, for the "Maxim" name I want to have 1 since that Name has only one ID, but for "Huashu" I want to have 2 because this name has two distinct ID. 

 

I was able to more or less achieve something similar but the problem is that when I'm using ALLSELECTED, ALL or ALLEXCEPT the visual returns all the possible rows and values and not restrict them by outer slicer filters (like here I have values only between 12/04/2023 and 10/07/2023. 

Does anyone know the answer? 

 



 

2 Replies

  • Anonymous all columns are from one single table or do you have different dimensions for region and date?

    • Anonymous's avatar
      Anonymous
      Not applicable

      In general I have different dimensions for region and date but in this case and visual, everything is from one table.