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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Vin_1234
New Member

Join and group by two different tables

Hi, 

How to Execute this sql query in Power Bi.

 

select
c.hrms_team_level_2,
c.hrms_team_level_3,
count (i.login_name) as num_users
from
[dbo].[psdp_capacity_enrich_pdr] c
join dbo.psdp_infra_logon_connections i
on i.nt_user_name = c.nt_login
group by
c.hrms_team_level_2, c.hrms_team_level_3

 

Vin_1234_0-1655294666863.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Vin_1234 ,

Create calculated table.

vyangliumsft_0-1655698323320.png

SUMMARIZE(
    FILTER(CROSSJOIN('psdp_capacity_enrich_pdr','psdp_infra_logon_connections'),
    [nt_login]=[nt_user_name]),[hrms_team_level_2],[hrms_team_level_3],[i.login_name],"num_users",
    COUNT(i.login_name)

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi  @Vin_1234 ,

Create calculated table.

vyangliumsft_0-1655698323320.png

SUMMARIZE(
    FILTER(CROSSJOIN('psdp_capacity_enrich_pdr','psdp_infra_logon_connections'),
    [nt_login]=[nt_user_name]),[hrms_team_level_2],[hrms_team_level_3],[i.login_name],"num_users",
    COUNT(i.login_name)

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.