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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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!:
The Definitive Guide to Power Query (M)

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!:
The Definitive Guide to Power Query (M)

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!:
The Definitive Guide to Power Query (M)

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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thank you.  This worked!!!!! 🙂

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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

Top Solution Authors
Top Kudoed Authors