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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
nabilassellalou
Regular Visitor

DAX

I have a data table on several columns, I want to count the number of "yes" rows for a single M1 and M4 (another column) for the same identifier because there are several M1 and M4 which are repeated for the same identifier.

 

1 ACCEPTED SOLUTION

Hi @nabilassellalou ,

 

Assuming you want to count the rows in Moment Mains that contain M1 or M4 and which value in Confirmite Mains is Oui (as you did not provide a sample result), try this formula. Replace M1 with M4  if computing for M4.

M1 = 
CALCULATE (
    COUNTROWS ( Feuil1 ),
    FILTER (
        ALLEXCEPT ( Feuil1, Feuil1[ID] ),
        CONTAINSSTRING ( Feuil1[Moment mains], "M1" )
            && Feuil1[Conformité mains] = "Oui"
    )
)

danextian_0-1712531802907.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

13 REPLIES 13
nabilassellalou
Regular Visitor

I cant post table 

nabilassellalou
Regular Visitor

I post images of columns of the used table. I would like to count the number of yes for a single M1 or M4 for same identifier 

 

danextian
Super User
Super User

Hi @nabilassellalou 

This is  just a sample formula based on the information provided.

CALCULATE (
    COUNTROWS ( 'table' ),
    'table'[M1 column] = "yes",
    'table'[M4 column] = "yes"
)

If this doesn't address your question, please provide a workable sample data (not an image) and your expected result from that sample data.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

MicrosoftTeams-image (148).png

MicrosoftTeams-image (149).png

  

Not images please. You can copy a table and paste it  here.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

have email to send table?

You can post a link to a cloud storage like One/Google Drive or DropBox.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

link is not public

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Its public now

 

Hi @nabilassellalou ,

 

Assuming you want to count the rows in Moment Mains that contain M1 or M4 and which value in Confirmite Mains is Oui (as you did not provide a sample result), try this formula. Replace M1 with M4  if computing for M4.

M1 = 
CALCULATE (
    COUNTROWS ( Feuil1 ),
    FILTER (
        ALLEXCEPT ( Feuil1, Feuil1[ID] ),
        CONTAINSSTRING ( Feuil1[Moment mains], "M1" )
            && Feuil1[Conformité mains] = "Oui"
    )
)

danextian_0-1712531802907.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Thank you, it's done.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.