cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
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!

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
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Microsoft Ignite

Microsoft Ignite with Arun Ulag

Featured Session: Drive Data Culture with Power BI- Vision, Strategy & Roadmap. Register here https://myignite.microsoft.com #MSIgnite #PowerPlatform #Power BI ​

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

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.

Top Solution Authors
Top Kudoed Authors
Users online (400)