cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Temrilan
Frequent Visitor

Count

Hi everyone!

 

My data looks like this:

ItemStatus
1.1yes
1.1yes
1.1no
1.2yes

1.3

no
1.3yes
1.4yes
1.4yes

 

I want to count the the item if every status in the second column for certain item equals yes.

For example, for the above table it would count 1.2 and 1.4.

Thanks in advance.

 

1 ACCEPTED SOLUTION
vivran22
Super User I
Super User I

Hey @Temrilan ,

 

You may try this:

Count = 
VAR _FIlter = 
    SUMMARIZECOLUMNS('Table'[Item],
    "No Count",COUNTROWS(FILTER('Table','Table'[Status] = "No")),
    "Yes Count",COUNTROWS(FILTER('Table','Table'[Status] = "Yes"))
    )
VAR _Count = 
    CALCULATE(
        DISTINCTCOUNT('Table'[Item]), FILTER(_FIlter, [No Count] = 0))
RETURN
_Count

 

Cheers!
Vivek

If it helps, please mark it as a solution. Kudos would be a cherry on the top 🙂
If it doesn't, then please share a sample data along with the expected results (preferably an excel file and not an image)

Blog: vivran.in/my-blog
Connect on LinkedIn
Follow on Twitter

View solution in original post

3 REPLIES 3
amitchandak
Super User IV
Super User IV

@Temrilan , Try this measure with item

countx(filter(summarize(Table, Table[Item], "_1", count(table[Status]), "_2" , calculate(count(table[Status]), table[Status] ="yes")), [_1]=[_2]),[Item])



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

vivran22
Super User I
Super User I

Hey @Temrilan ,

 

You may try this:

Count = 
VAR _FIlter = 
    SUMMARIZECOLUMNS('Table'[Item],
    "No Count",COUNTROWS(FILTER('Table','Table'[Status] = "No")),
    "Yes Count",COUNTROWS(FILTER('Table','Table'[Status] = "Yes"))
    )
VAR _Count = 
    CALCULATE(
        DISTINCTCOUNT('Table'[Item]), FILTER(_FIlter, [No Count] = 0))
RETURN
_Count

 

Cheers!
Vivek

If it helps, please mark it as a solution. Kudos would be a cherry on the top 🙂
If it doesn't, then please share a sample data along with the expected results (preferably an excel file and not an image)

Blog: vivran.in/my-blog
Connect on LinkedIn
Follow on Twitter

View solution in original post

It just gives me the count of yes in the second column. I want to count items with all yes in status.

Helpful resources

Announcements
User Groups Public Preview

Join us for our User Group Public Preview!

Power BI User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

March Update

Check it Out!

Click here to read more about the March 2021 Updates!

secondImage

The largest Power BI virtual conference

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