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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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
Anonymous
Not applicable

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

View solution in original post

1 REPLY 1
Anonymous
Not applicable

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.