Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
chiru5262
Helper III
Helper III

Distinct Filter not giving the result expected

Below is my issue when I do distinctcount on 'assetnum' the total is 4145, but when I seperate them by filter BM/CM the count total is 2020+2425  which is 4445 which doesnt match with 4145.

I did exported and checked the 4145 for some reason its excluding the worktype = 'BM','CM' filter not sure why.

 

@amitchandak @lbendlin could you please help, appreciate it

 

Capture.PNG

1 ACCEPTED SOLUTION

I think you can achieve your goal with the 'Visual Calculations'.

 

Using visual calculations in Power BI Desktop - Power BI | Microsoft Learn

 

mickey64_0-1722790865109.png

 

View solution in original post

7 REPLIES 7
mickey64
Super User
Super User

I don't know your detailed data, so I'll explain with a simple data example.
In the table below, if you run "DISTINCTCOUNT" on just "BM", the result will be "4".
Also, if you run "DISTINCTCOUNT" on just "CM", the result will be "3", and the sum of these is "7" (=4+3).
But if you run "DISTINCTCOUNT" on "BM&CM", the result will be "6". This is because there is duplicate "Assetnum" data, as marked in yellow in the table.

 

mickey64_0-1722769323274.png

 

Hi @mickey64 

 

That makes sense, but how can I acheive 7, as I need the output of 7 for my case.

 

appreciate your help

 

Thanks,

Chiru

I think you can achieve your goal with the 'Visual Calculations'.

 

Using visual calculations in Power BI Desktop - Power BI | Microsoft Learn

 

mickey64_0-1722790865109.png

 

@mickey64  You are legend mate, thanks thats works

You need to materialize the individual calculations via SUMMARIZE or SUMMARIZECOLUMNS  if you want the DISTINCTCOUNT by category rather than across categories.

@lbendlin  thanks for your response, could you please send me the dax measure I can use for the above.

@mickey64  or any way to show that unique 1 assetnum which had both BM and CM against it

Helpful resources

Announcements
Top Kudoed Authors