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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.