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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

6 REPLIES 6
Greg_Deckler
Community Champion
Community Champion

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!:
DAX For Humans

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!:
DAX For Humans

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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thank you.  This worked!!!!! 🙂

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.