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

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
Community Champion
Community Champion

Hey @Anonymous ,

 

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
Super User

@Anonymous , 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])

vivran22
Community Champion
Community Champion

Hey @Anonymous ,

 

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

Anonymous
Not applicable

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
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.