cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Hicham Helper II
Helper II

Distinct count measure

Hi everyone,

I would like to do this measure : 

calculate the number of interventions using the distinctcount function for which there is neither the "A61" nor the "A62" intervention, but also does not take into account other interventions including the co-response codes A61 AND A62 Here is the table. Table name: Table.  So for this example, the result will be : 3

Another information: there are a lot of data like this. 

 

65+.PNG

Thank you, My best regards. 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User I
Super User I

Re: Distinct count measure

Add a column that tracks if your Column1 has one A61/2 row
Has6162=
VAR thisOpCode=Table[Column1]
RETURN
IF(SUMX(FILTER(Table;Table[Column1]=thisOpCode);IF(Table[Column2] IN {"A61";"A62"};1;0))>=1;1;0)

 

this column will (should 🙂 ) contain 1 if that opcode has at least one A61, A62

 

Now your measure will count only the ones where that value is 0

Measure=DISTINCTCOUNT(FILTER(Table;Table[Has6162] =0);Table[Column1])


Check syntax and test, but should work





Did I answer your question? Mark my post as a solution!

PLEASE follow these instructions to ask your questions!


Proud to be a Super User!




View solution in original post

1 REPLY 1
Super User I
Super User I

Re: Distinct count measure

Add a column that tracks if your Column1 has one A61/2 row
Has6162=
VAR thisOpCode=Table[Column1]
RETURN
IF(SUMX(FILTER(Table;Table[Column1]=thisOpCode);IF(Table[Column2] IN {"A61";"A62"};1;0))>=1;1;0)

 

this column will (should 🙂 ) contain 1 if that opcode has at least one A61, A62

 

Now your measure will count only the ones where that value is 0

Measure=DISTINCTCOUNT(FILTER(Table;Table[Has6162] =0);Table[Column1])


Check syntax and test, but should work





Did I answer your question? Mark my post as a solution!

PLEASE follow these instructions to ask your questions!


Proud to be a Super User!




View solution in original post

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors