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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Reetz
Helper II
Helper II

I think I need a count rows or group by but it doesn't work

Capture.PNGI have a survey table that I am trying to find the unique # of rooms where the Meet Criteria equals YES.  I don't have access to the table so can't transform it.  I think I need to either group by or count rows, but can't figure out how.  Can someone help please?  Thanks in advance!!!

1 ACCEPTED SOLUTION

Sorry, I totally screwed up the parens on that:

 

Table = 
  ADDCOLUMNS(
    FILTER('Table',[Question] = "Room #")
    "Meets Criteria",
      MAXX(
        FILTER(
          'Table',
          [Survey]=EARLIER([Survey]) && 
            [Survey Response] = EARLIER([Survey Response])
        ),
        [Response])
      )
  )


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

6 REPLIES 6
Greg_Deckler
Super User
Super User

COUNTROWS(
SUMMARIZE(
FILTER('Table',[Meet Criteria] = "Yes"),
[Room]
)
)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler Thank you so much for your quick response.  The Room number/Match in the middle of my picture was just an illustration to show the data easily.  My actual table that I am trying to write my dax off of is on the left.

Oh, you need to first add a column using EARLIER. See my article on Mean Time Between Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395...

 

I probably create an entirely new table maybe, like:

Table = 
  ADDCOLUMNS(
    FILTER('Table',[Question] = "Room #")
    "Meets Criteria",MAXX(FILTER('Table',[Survey]=EARLIER([Survey] && [Survey Response] = EARLIER([Survey Response]),[Response])
  )


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler   Thank you for this explaination!!  I am newer to power bi and am not familiar with some of these functions.  I did read your article, and tried the DAX you provided but am getting the attached error.  Have tried looking up what the error may be but am still getting this error. Capture.PNG

Sorry, I totally screwed up the parens on that:

 

Table = 
  ADDCOLUMNS(
    FILTER('Table',[Question] = "Room #")
    "Meets Criteria",
      MAXX(
        FILTER(
          'Table',
          [Survey]=EARLIER([Survey]) && 
            [Survey Response] = EARLIER([Survey Response])
        ),
        [Response])
      )
  )


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Thank you.  This worked!!!!! 🙂

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.