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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
jhonKy0t
Regular Visitor

SQL Management Studio output is not the same with Power BI Visual Table.

I have a query that runs like this:

 

 

SELECT H.TKT_DAT,
	L.ITEM_NO
FROM VI_PS_DOC_HDR H JOIN VI_PS_DOC_LIN L ON H.DOC_ID = L.DOC_ID
	JOIN PO_VEND P ON L.ITEM_VEND_NO = P.VEND_NO  
WHERE H.TKT_TYP = 'T' AND H.DOC_TYP = 'T' AND H.DEP_ONLY_TKT='N' and L.LIN_TYP IN ('S','R')

 

 

When I run it in SQL Management Studio, it outputs only 2 items. But if I run in Power BI it outputs several items.

And even if I output only H.TKT_DAT in the Power BI Visual table, it shows 4 items.

 

I already checked the Power BI relationship of the tables and it seems to be correct. The only difference is the filter in selection of L.LIN_TYP is only "S" because there's no "R" in the row data.

 

jhonKy0t_0-1701117358093.png

 

jhonKy0t_1-1701117414270.png

 

jhonKy0t_2-1701117452500.png

 

jhonKy0t_3-1701117627753.png

 

 

3 REPLIES 3
Anonymous
Not applicable

Hi @jhonKy0t ,

 

I'm guessing you have Include relationship columns checked, and it will return all the associated data.

Please uncheck the box to try.

vtianyichmsft_1-1701239566080.png

 

Please feel free to correct me and provide more information if I have misunderstood you!

 

An attachment for your reference. Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

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

 

jhonKy0t
Regular Visitor

It just outputs the number of rows in each of the date

jhonKy0t_0-1701143087868.png

 

amitchandak
Super User
Super User

@jhonKy0t , Try a measure like this

Calculate( Countrows(Summarize(VI_PS_DOC_LIN , VI_PS_DOC_HDR [TKT_DAT], VI_PS_DOC_LIN[ITEM_NO])), filter(VI_PS_DOC_HDR , [TKT_TYP] = "T" && [DOC_TYP] = "T" && [DEP_ONLY_TKT]="N"), filter(VI_PS_DOC_LIN, VI_PS_DOC_LIN[LIN_TYP] in {"S", "R"}))

 

Assuming line table is on many side

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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