cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
hxkresl Helper V
Helper V

DAX equivalent for GROUP BY across three related tables?

How to get COUNT(Applications for-which-there's-a-corresponding-alert) BY LOBName???

 

(Applications come from mc_applications table, Alerts from mc_alerts table, and LOBName from mc_lineofbusinesses table)  

 

example of results I will need 

 

LineOfBusinessA5
LineOfBusinessB3
LineOfBusinessC8

 

If an alert exists in mc_alerts table it's corresponding application in mc_application needs to be counted and the count-of-applications grouped by LOBname in mc_lineofbusinesses table.

 Capture1.PNG

 

 

SQL equiv

SELECT LineOfBusiness, Count(ApplicationName) FROM mc_LineOfBusinesses JOINED to mc_Applications LEFT JOINED to mc_Alerts a WHERE a.mc_alertid IS NOT NULL GROUP BY LineOfBusiness. 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User IV
Super User IV

Re: DAX equivalent for GROUP BY across three related tables?

You would want to go to your data model, select "Modeling" tab and select New Table and use that formula for your new table.


---------------------------------------

Not the Power BI thought police...

I have NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

5 REPLIES 5
Super User IV
Super User IV

Re: DAX equivalent for GROUP BY across three related tables?

You should just be able to use a Matrix visualization for that. 


---------------------------------------

Not the Power BI thought police...

I have NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

hxkresl Helper V
Helper V

Re: DAX equivalent for GROUP BY across three related tables?

@Greg_Deckler

 

i need a measure because next I'll be Ranking results of groupby and using that to sort a report visualization.

Super User IV
Super User IV

Re: DAX equivalent for GROUP BY across three related tables?

Probably going to need to do a SUMMARIZE then.


---------------------------------------

Not the Power BI thought police...

I have NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

hxkresl Helper V
Helper V

Re: DAX equivalent for GROUP BY across three related tables?

I tried 

LOBAppCount = SUMMARIZE(mc_lineofbusinesses, mc_lineofbusinesses[mc_lineofbusinessid], "CountLOBApplications", COUNT(mc_applications[ApplicationName]))

 

with error

Capture3.PNG

 

I will continue to work on this, but if anyone can chip in ideas for fix, I will appreciate it.

Super User IV
Super User IV

Re: DAX equivalent for GROUP BY across three related tables?

You would want to go to your data model, select "Modeling" tab and select New Table and use that formula for your new table.


---------------------------------------

Not the Power BI thought police...

I have NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors