cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Ramzay Frequent Visitor
Frequent Visitor

Implementing in DAX SQL query with COUNT and GROUP BY

In need to implement in DAX a table definition similar to the result of the following simple SQL query:

SELECT
   Col1,
   Col2,
   Col3,
   COUNT(*)
FROM Tab1
GROUP BY 
  Col1,
  Col2,
  Col3

Thank you.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User IV
Super User IV

Re: Implementing in DAX SQL query with COUNT and GROUP BY

Add new measure with following formula

 

TotalCount = COUNTROWS('your table name')

Now add Table visual and drop you col1, col2, col3 and TotalCount measure on it, it should do it.






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

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

2 REPLIES 2
Super User IV
Super User IV

Re: Implementing in DAX SQL query with COUNT and GROUP BY

Add new measure with following formula

 

TotalCount = COUNTROWS('your table name')

Now add Table visual and drop you col1, col2, col3 and TotalCount measure on it, it should do it.






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

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

Ramzay Frequent Visitor
Frequent Visitor

Re: Implementing in DAX SQL query with COUNT and GROUP BY

Thanks.  That is what I need.

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Top Solution Authors
Top Kudoed Authors