Forum Discussion
Distinct Count from different rows measure
Hi Try to replace
COUNT ( 'Medical Case'[Acct Src Id] )
with
DISTINCTCOUNT ( 'Medical Case'[Acct Src Id] ),
some_bih tried that already but nothing will change, I believe that it will only count the distinct in the 'Medical Case'[Acct Src Id] for every matching condition, for example if I will receive Sub_name = 123 it will count distinct for that particular row and then it will evaluate the second match and count again, so distinct count will not do my requirment in this case as it is counting for every match in the sub_name
- some_bih2 years agoCommunity Champion
Hi Zakhamido not enought info for some detailed reply, as model is not availabe, but do you need then COUNTX instead of SUMX if calculation logic is as you described.
- Zakhamido2 years agoFrequent Visitor
some_bih I think it is better if I will explain my requirements in details so you can thankfully advise me on the approach,
I have 2 tables one in direct query and the other in import mode
The first table is called TibcoIncident which is for outage affected substations data and the other table is called Medical Case which will have all the customers that is registered that Have a critical medical devices, now I want for every record to come in the TibcoIncident Table to check if this substation is available in the table 'Medical Case' and then count the number of affected customers from that table and then display the number of the measure in card
Now I am able to fulfil my requirment with the function I mentioned but I am having an issue where sometimes I will receive a duplicate rows in the table TibcoIncident (can't be fixed at the moment) my function will count the matched customers twice as I do have 2 rows and I can't remove duplicates in the power query editor due to other requirements
What I want is to count distinct Sub_name when the conditions match
Thanks again for helping