cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
BI_Analyticz
Helper V
Helper V

Count the Items which has single status

Hi, I have been breaking my head to find the solution. I have a list of assets. Need to count the assets if it only has the FIXED status and not having any other rows with different status, also with Patch Type OS. I need to display the count for each domain.

 

For example if you look at the below table. For Domain ABC we should M2 since it belongs to patch type OS and with status as Fixed. But M1 belongs to OS but it has both Active and Fixed status.

 

So healthy machine for ABC domain is 1.

 

DomainMachineStatusPatch Type
ABCM1ActiveOS
ABCM1ActiveOS
ABCM1FixedOS
ABCM1FixedOS
ABCM1FixedOS
ABCM2FixedOS
ABCM2FixedOS
ABCM2FixedOS
ABCM3FixedHardware
ABCM3FixedHardware
ABCM3FixedHardware
ABCM3FixedHardware
ABCM3FixedHardware
ABCM3FixedHardware
1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @BI_Analyticz 

 

You can create below measure. 'Table' is my table's name, replace it with yours.

Measure = 
VAR vTable = FILTER('Table','Table'[Patch Type]="OS")
VAR vTable2 = SUMMARIZE(vTable,'Table'[Domain],'Table'[Machine],"All_Status",CONCATENATEX(VALUES('Table'[Status]),'Table'[Status],","))
RETURN
COUNTROWS(FILTER(vTable2,[All_Status]="Fixed"))

 

Then you can add a table visual in the report, put Domain column and this measure into it to show the count for each domain. See the attachment. 

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

 

View solution in original post

3 REPLIES 3
v-jingzhang
Community Support
Community Support

Hi @BI_Analyticz 

 

You can create below measure. 'Table' is my table's name, replace it with yours.

Measure = 
VAR vTable = FILTER('Table','Table'[Patch Type]="OS")
VAR vTable2 = SUMMARIZE(vTable,'Table'[Domain],'Table'[Machine],"All_Status",CONCATENATEX(VALUES('Table'[Status]),'Table'[Status],","))
RETURN
COUNTROWS(FILTER(vTable2,[All_Status]="Fixed"))

 

Then you can add a table visual in the report, put Domain column and this measure into it to show the count for each domain. See the attachment. 

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

 

amitchandak
Super User
Super User

@BI_Analyticz , Try a measure like

 

countx(filter(summarize(Table, Table[Domain], Table[Machine],"_1",, distinctCOUNT(Table[Status])), [_1]=1),[Machine] )

@amitchandak Thanks for replying. I am getting some syntax error. Need help pls.

 

BI_Analyticz_0-1635835147473.png

 

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors